Make container more robust #95
Reference in New Issue
Block a user
Delete Branch "container-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Good direction consolidating Caddy and Django into a single container. Here are a few things to consider:
1. Unpinned Caddy download (
Dockerfile:33)Downloading Caddy from the API without a version or checksum is a reproducibility and supply-chain concern. Consider pinning to a specific version via URL (e.g.,
...v2.9.1/...) or verifying the download.2.
/home/timetracker/apppermissions in entrypoint (entrypoint.sh:14-15)chmod 755on the app directory and.venvare part of the image and should already have correct permissions from the build step. The entrypoint should only adjust paths/volumes.3. Undocumented environment variables
DATA_DIR,PUID,PGID, andDOCKER_STORAGE_PATHare introduced across the Dockerfile/docker-compose/entrypoint but aren't documented (e.g., no.env.example).4.
supervisor.confpath (Dockerfile:39)The supervisor config is copied to
/etc/supervisor/conf.d/supervisor.conf, but supervisord typically expects separate.conffiles in theconf.d/directory. Consider whether the COPY should target/etc/supervisord.confinstead, withfiles = /etc/supervisor/conf.d/*.confin the main config.5. Database path (
settings.py:113)The database now uses
DATA_DIRenv var, which is good for backups. The volume mount for/home/timetracker/datain docker-compose.yml makes this work — just worth noting for anyone reading the PR.Regarding #1 (unpinned Caddy download), here's a proposed fix:
Current (
Dockerfile:35-36):Proposed:
Why:
ARGmakes it trivial to bump the version laterHappy to open a separate PR with this fix if you'd like.