feat: enhance Dockerfile and entrypoint for user permissions and environment variable handling
All checks were successful
Build and publish Docker image / build-and-push (release) Successful in 1m50s
All checks were successful
Build and publish Docker image / build-and-push (release) Successful in 1m50s
This commit is contained in:
27
README.md
27
README.md
@@ -1,16 +1,31 @@
|
||||
Here is example usage of `docker-compose.yml`:
|
||||
# Tally Counter
|
||||
|
||||
Run the app with Docker Compose (recommended). The container startup/entrypoint will create the runtime folders and apply migrations; pass numeric PUID/PGID via environment to run as a non-root user.
|
||||
|
||||
|
||||
```yaml
|
||||
service
|
||||
services:
|
||||
tally-counter:
|
||||
image: gitea.kanawave.net/sebastas/tally-counter:latest #this image
|
||||
container_name: tally-counter
|
||||
user: 2000:2000 #uid:gid
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy # traefik proxy network
|
||||
- proxy # connect any proxy networks (for traefik)
|
||||
environment:
|
||||
- PUID=1000 # host uid forwarded to container
|
||||
- PGID=1000 # host gid forwarded to container
|
||||
ports:
|
||||
- "3000:3000" # Set whatever port you want on the left side (host)
|
||||
volumes:
|
||||
- ./tally-counter:/data # for persistant storage (db + uploads)
|
||||
- ./tally-counter:/data # persistent DB + uploads (bind mount)
|
||||
```
|
||||
|
||||
Quick and dirty setup!
|
||||
Add any `labels` for traefik
|
||||
|
||||
### Notes & tips
|
||||
|
||||
The entrypoint will:
|
||||
- ensure `$DATA_DIR` exists,
|
||||
- create `sqlite.db` if missing,
|
||||
- run `prisma migrate deploy` (if CLI available and migrations exist),
|
||||
- then drop privileges to the provided `PUID:PGID` and exec the app.
|
||||
|
||||
Reference in New Issue
Block a user