You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEPLOYMENT.md
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,14 @@ This project is automatically built and published to GitHub Container Registry (
7
7
### 1. Deploy with Docker Run
8
8
9
9
```bash
10
+
# Get your user and group IDs
11
+
USER_ID=$(id -u)
12
+
GROUP_ID=$(id -g)
13
+
10
14
# Create directories for persistent data
11
15
mkdir -p ./data ./backups ./logs
12
16
13
-
# Run the container
17
+
# Run the container with proper user/group IDs
14
18
docker run -d \
15
19
--name github-backup \
16
20
--restart unless-stopped \
@@ -19,6 +23,8 @@ docker run -d \
19
23
-v $(pwd)/backups:/app/backups \
20
24
-v $(pwd)/logs:/app/logs \
21
25
-e SECRET_KEY="$(openssl rand -base64 32)" \
26
+
-e PUID=${USER_ID} \
27
+
-e PGID=${GROUP_ID} \
22
28
ghcr.io/gittimeraider/githubbackup:latest
23
29
```
24
30
@@ -52,6 +58,9 @@ services:
52
58
53
59
Then run:
54
60
```bash
61
+
# Set your user/group IDs and secret key
62
+
export PUID=$(id -u)
63
+
export PGID=$(id -g)
55
64
export SECRET_KEY=$(openssl rand -base64 32)
56
65
docker-compose up -d
57
66
```
@@ -138,6 +147,10 @@ Create a `.env` file for environment variables:
138
147
# Required: Change this in production
139
148
SECRET_KEY=your-super-secret-key-here
140
149
150
+
# User/Group IDs for proper file permissions
151
+
PUID=1000 # Your user ID (run 'id -u' to get this)
152
+
PGID=1000 # Your group ID (run 'id -g' to get this)
153
+
141
154
# Optional: Database (defaults to SQLite)
142
155
DATABASE_URL=sqlite:///data/github_backup.db
143
156
@@ -146,6 +159,33 @@ FLASK_ENV=production
146
159
LOG_LEVEL=INFO
147
160
```
148
161
162
+
#### Understanding PUID and PGID
163
+
164
+
The `PUID` (Process User ID) and `PGID` (Process Group ID) environment variables allow you to run the container with the same user and group IDs as your host system user. This ensures that:
165
+
166
+
- Files created by the container have the correct ownership
167
+
- You can read/write the mounted volumes without permission issues
0 commit comments