feat: add Docker Compose setup with bind-mount appdata directory
- Dockerfile builds image with app source in /app_src - docker-entrypoint.sh syncs code from image on each start, inits DB - docker-compose.yml mounts ./appdata:/app for easy backup - backend/init_db.py for safe DB init (no drop_all) - backend/database.py supports DATABASE_URL env var - .dockerignore excludes venv, __pycache__, *.db, .git Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
docker-entrypoint.sh
Normal file
11
docker-entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Sync app code from image on every start (keeps code fresh after rebuilds)
|
||||
rm -rf /app/backend /app/frontend
|
||||
cp -r /app_src/backend /app_src/frontend /app/
|
||||
|
||||
mkdir -p /app/data
|
||||
python -m backend.init_db
|
||||
|
||||
exec uvicorn backend.main:app --host 0.0.0.0 --port 8000
|
||||
Reference in New Issue
Block a user