services: api: build: context: ./backend dockerfile: Dockerfile network: host command: sh -c "python -m src.bootstrap_database && alembic upgrade head && uvicorn src.app_factory:create_app --factory --host 0.0.0.0 --port 8000 --reload" env_file: .env environment: FRONTMATTER_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:15432/frontmatter FRONTMATTER_REDIS_URL: redis://localhost:16379/0 HTTP_PROXY: ${DOCKER_RUNTIME_HTTP_PROXY:-} HTTPS_PROXY: ${DOCKER_RUNTIME_HTTPS_PROXY:-} NO_PROXY: ${DOCKER_RUNTIME_NO_PROXY:-localhost,127.0.0.1,::1} network_mode: host volumes: - ./backend/src:/app/src depends_on: db: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8000/api/v1/health')"] interval: 10s timeout: 5s retries: 3 web: build: context: ./frontend dockerfile: Dockerfile network: host command: npm run start environment: - API_PROXY_TARGET=http://host.docker.internal:8000 extra_hosts: - "host.docker.internal:host-gateway" depends_on: - api db: image: pgvector/pgvector:pg16 environment: POSTGRES_DB: frontmatter POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "15432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 3s retries: 5 redis: image: redis:7-alpine ports: - "16379:6379" volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 nginx: image: nginx:alpine ports: - "${PUBLIC_HTTP_PORT:-8080}:80" extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro depends_on: - api - web volumes: pgdata: redisdata: