Skip to content

Commit d4e7049

Browse files
author
codewec
committed
fix: container user
1 parent 31fcb03 commit d4e7049

4 files changed

Lines changed: 59 additions & 0 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PUID=1000
2+
PGID=1000

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Run a prebuilt image from GHCR:
3535

3636
```bash
3737
docker run --name editoro \
38+
--user 1000:1000 \
3839
-p 3000:3000 \
3940
-v $(pwd)/data:/app/data \
4041
ghcr.io/codewec/editoro:latest
@@ -44,8 +45,62 @@ Then open `http://localhost:3000`.
4445

4546
Run with Docker Compose:
4647

48+
Minimal `docker-compose.yml` (no `.env`):
49+
50+
```yaml
51+
services:
52+
editoro:
53+
image: ghcr.io/codewec/editoro:latest
54+
container_name: editoro
55+
restart: unless-stopped
56+
ports:
57+
- "3000:3000"
58+
volumes:
59+
- ./data:/app/data
60+
```
61+
62+
```bash
63+
mkdir -p data
64+
docker compose up -d
65+
```
66+
67+
If you need custom file ownership inside `./data`, use `.env` + full compose config:
68+
69+
`.env`
70+
71+
```env
72+
PUID=1000
73+
PGID=1000
74+
```
75+
76+
`docker-compose.yml`
77+
78+
```yaml
79+
services:
80+
editoro:
81+
image: ghcr.io/codewec/editoro:latest
82+
container_name: editoro
83+
restart: unless-stopped
84+
user: "${PUID:-1000}:${PGID:-1000}"
85+
ports:
86+
- "3000:3000"
87+
volumes:
88+
- ./data:/app/data
89+
```
90+
4791
```bash
92+
mkdir -p data
93+
docker compose pull
4894
docker compose up -d
95+
docker compose logs -f
96+
```
97+
98+
`PUID` and `PGID` define which host user/group owns newly created files in `./data` (default `1000:1000`).
99+
If needed, align host directory permissions before startup:
100+
101+
```bash
102+
mkdir -p data
103+
sudo chown -R 1000:1000 data
49104
```
50105

51106
LXD quick start (example):

deploy/lxc/lxd-editoro.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ config:
1616
editoro:
1717
image: ghcr.io/codewec/editoro:dev
1818
restart: unless-stopped
19+
user: "1000:1000"
1920
ports:
2021
- "3000:3000"
2122
volumes:

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ services:
33
image: ghcr.io/codewec/editoro:dev
44
container_name: editoro
55
restart: unless-stopped
6+
user: "${PUID:-1000}:${PGID:-1000}"
67
ports:
78
- "3000:3000"
89
volumes:

0 commit comments

Comments
 (0)