Add local-first SPA architecture and containerized production deploy.
Move data access to use-cases and IndexedDB repositories with optional remote fallback, changelog/sync ports, and encrypted local backup. Add production Docker Compose (nginx frontend + optional backend) and Apache host proxy configuration for deployment. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile.prod
|
||||
args:
|
||||
VITE_DATA_MODE: ${VITE_DATA_MODE:-local}
|
||||
container_name: sg_frontend
|
||||
ports:
|
||||
- "${FRONTEND_BIND:-127.0.0.1}:${FRONTEND_PORT:-8080}:80"
|
||||
restart: unless-stopped
|
||||
|
||||
backend:
|
||||
profiles: ["with-backend"]
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile.prod
|
||||
container_name: sg_backend
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: config.settings
|
||||
SECRET_KEY: ${DJANGO_SECRET_KEY:-change-me-in-production}
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1}
|
||||
DATABASE_PATH: /app/data/db.sqlite3
|
||||
volumes:
|
||||
- sqlite_data:/app/data
|
||||
ports:
|
||||
- "${BACKEND_BIND:-127.0.0.1}:${BACKEND_PORT:-8000}:8000"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
sqlite_data:
|
||||
Reference in New Issue
Block a user