# newzy — full application stack (FastAPI backend + Nginx frontend). # # make dev # build (if needed) and start both services in the background # make stop # stop and remove the containers (local data is kept) # make clean # stop everything and remove containers, volumes and data/ # # Environment variables are read from `.env` in this directory (template: # `.env.example`). See README.md for the complete developer documentation. # # The `version` key is intentionally omitted: it is obsolete in Compose v2 # and only produces a deprecation warning. services: backend: build: context: ./backend dockerfile: Dockerfile ports: - "8000:8000" volumes: # Persistent SQLite database: ./data/db on the host -> /app/data/db # inside the container (excluded from git, see data/.gitignore). - ./data/db:/app/data/db environment: - DATABASE_URL=sqlite:///./data/db/newzy.db - DEBUG=false - BACKEND_CORS_ORIGINS=http://localhost:3000,http://localhost:5173 # JWT signing key (override in .env; the backend falls back to a dev # default when unset). Never use the dev default in production. - HN_SECRET_KEY=${HN_SECRET_KEY:-newzy-dev-secret-change-me} healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 30s timeout: 5s retries: 3 start_period: 10s networks: - newzy-network restart: unless-stopped frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "3000:80" depends_on: backend: condition: service_healthy networks: - newzy-network restart: unless-stopped networks: newzy-network: driver: bridge ipam: config: - subnet: 172.28.0.0/16 volumes: db-data: name: newzy-db-data