Skip to content

Commit bfc136c

Browse files
author
Raffael Herrmann
committed
Simplify volume mount path using symlink: ./db.json:/data/db.json:ro
1 parent 79050b2 commit bfc136c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ ENV VERSION=${VERSION}
88
# Copy the public directory contents to the nginx html directory
99
COPY public/ /usr/share/nginx/html/
1010

11+
# Create symlink for cleaner volume mounting
12+
RUN mkdir -p /data && ln -s /data/db.json /usr/share/nginx/html/data/db.json
13+
1114
# Replace version placeholder
1215
RUN sed -i "s/__VERSION__/${VERSION}/g" /usr/share/nginx/html/index.html
1316

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ A modern web interface for browsing and searching your MassCode snippets with sy
2727
Open `docker-compose.yml` and update the volume path to point to your local MassCode `db.json` file:
2828
```yaml
2929
volumes:
30-
- /path/to/your/masscode/db.json:/usr/share/nginx/html/data/db.json:ro
30+
- /path/to/your/masscode/db.json:/data/db.json:ro
3131
```
3232
3333
3. **Run the application**:
@@ -46,15 +46,15 @@ The `docker-compose.yml` includes a volume mount that maps your local `db.json`
4646

4747
```yaml
4848
volumes:
49-
- ./db.json:/usr/share/nginx/html/data/db.json:ro
49+
- ./db.json:/data/db.json:ro
5050
```
5151
5252
**Important**: Update the left side (`./db.json`) to the actual path of your MassCode database file. The volume is read-only to prevent accidental modifications to your data.
5353

5454
### Manual Docker Run
5555

5656
```bash
57-
docker run -d -p 8080:80 -v /path/to/your/db.json:/usr/share/nginx/html/data/db.json:ro ghcr.io/codebude/masscode-web:latest
57+
docker run -d -p 8080:80 -v /path/to/your/db.json:/data/db.json:ro ghcr.io/codebude/masscode-web:latest
5858
```
5959

6060
## 🎯 What is MassCode?

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ services:
44
ports:
55
- "8080:80"
66
volumes:
7-
- ./db.json:/usr/share/nginx/html/data/db.json:ro
7+
- ./db.json:/data/db.json:ro
88
restart: unless-stopped

0 commit comments

Comments
 (0)