Skip to content

Commit eaebc1e

Browse files
Copilotthawn
andcommitted
Move data mount point from /var/lib/ttmp32gme to /data
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
1 parent b42248f commit eaebc1e

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

build/docker/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ RUN groupadd -g 1000 ttmp32gme && \
4343

4444
# Set up directories and copy config
4545
# Use proper permissions instead of 777 for security
46-
ENV APPDATA=/var/lib/
47-
RUN mkdir -p ${APPDATA}/ttmp32gme/library /mnt/tiptoi && \
48-
cp /app/src/ttmp32gme/config.sqlite ${APPDATA}/ttmp32gme/ && \
49-
chown -R ttmp32gme:ttmp32gme ${APPDATA}/ttmp32gme /mnt/tiptoi && \
50-
chmod -R 775 ${APPDATA}/ttmp32gme && \
51-
chmod 664 ${APPDATA}/ttmp32gme/config.sqlite
46+
RUN mkdir -p /data/library /mnt/tiptoi && \
47+
cp /app/src/ttmp32gme/config.sqlite /data/ && \
48+
chown -R ttmp32gme:ttmp32gme /data /mnt/tiptoi && \
49+
chmod -R 775 /data && \
50+
chmod 664 /data/config.sqlite
5251

5352
# Declare volumes for persistent data
5453
# This helps Podman/Docker users understand which directories should be mounted
55-
VOLUME ["${APPDATA}/ttmp32gme", "/mnt/tiptoi"]
54+
VOLUME ["/data", "/mnt/tiptoi"]
5655

5756
# Expose port 8080
5857
EXPOSE 8080
@@ -61,7 +60,7 @@ EXPOSE 8080
6160
USER ttmp32gme
6261

6362
# Run the Python backend
64-
CMD ["python", "-m", "ttmp32gme.ttmp32gme", "--host=0.0.0.0", "--port=8080", "--database=/var/lib/ttmp32gme/config.sqlite", "--library=/var/lib/ttmp32gme/library"]
63+
CMD ["python", "-m", "ttmp32gme.ttmp32gme", "--host=0.0.0.0", "--port=8080", "--database=/data/config.sqlite", "--library=/data/library"]
6564

6665
# Optional health check
6766
HEALTHCHECK --interval=5m --timeout=3s \

build/docker/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ docker run -d \
1717
--rm \
1818
--name ttmp32gme \
1919
--publish 8080:8080 \
20-
--volume ttmp32gme-data:/var/lib/ttmp32gme \
20+
--volume ttmp32gme-data:/data \
2121
--volume /path/to/tiptoi:/mnt/tiptoi \
2222
thawn/ttmp32gme:latest
2323
```
@@ -29,7 +29,7 @@ podman run -d \
2929
--rm \
3030
--name ttmp32gme \
3131
--publish 8080:8080 \
32-
--volume ttmp32gme-data:/var/lib/ttmp32gme \
32+
--volume ttmp32gme-data:/data \
3333
--volume /path/to/tiptoi:/mnt/tiptoi:Z \
3434
thawn/ttmp32gme:latest
3535
```
@@ -38,7 +38,7 @@ podman run -d \
3838

3939
## Volume Mounts
4040

41-
- **`/var/lib/ttmp32gme`**: Application data (database, generated library files)
41+
- **`/data`**: Application data (database, generated library files)
4242
- First run: Container initializes this directory with default config
4343
- Subsequent runs: Uses existing data for persistence
4444

@@ -56,7 +56,7 @@ Podman automatically maps the container user to your host user, so permissions w
5656
```bash
5757
# Your files will be owned by your user on the host
5858
podman run --rm \
59-
--volume ./my-data:/var/lib/ttmp32gme \
59+
--volume ./my-data:/data \
6060
--volume /media/tiptoi:/mnt/tiptoi:Z \
6161
--publish 8080:8080 \
6262
thawn/ttmp32gme:latest
@@ -69,7 +69,7 @@ If you encounter permission issues, you can use these options:
6969
1. **Option 1**: Match your user ID (recommended)
7070
```bash
7171
docker run --user $(id -u):$(id -g) \
72-
--volume ./my-data:/var/lib/ttmp32gme \
72+
--volume ./my-data:/data \
7373
--volume /media/tiptoi:/mnt/tiptoi \
7474
--publish 8080:8080 \
7575
thawn/ttmp32gme:latest
@@ -100,7 +100,7 @@ docker run -d \
100100
--env HOST=127.0.0.1 \
101101
--env PORT=9000 \
102102
--publish 9000:9000 \
103-
--volume ttmp32gme-data:/var/lib/ttmp32gme \
103+
--volume ttmp32gme-data:/data \
104104
thawn/ttmp32gme:latest
105105
```
106106

@@ -123,7 +123,7 @@ If you get "permission denied" errors when accessing volumes:
123123
**For Podman**:
124124
```bash
125125
# Add :Z flag for SELinux systems
126-
podman run --volume /path/to/data:/var/lib/ttmp32gme:Z ...
126+
podman run --volume /path/to/data:/data:Z ...
127127
```
128128

129129
**For Docker**:

0 commit comments

Comments
 (0)