Add nginx reverse proxy and environment configuration

- Add nginx.conf for proxying API requests to backend
- Update frontend Dockerfile for production build with nginx
- Move hardcoded values to .env variables in docker-compose.yml
- Add .env.example template for configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-12 11:02:33 +03:00
parent 266f3768ef
commit 333de65fbd
4 changed files with 175 additions and 22 deletions

View File

@@ -3,16 +3,16 @@ services:
image: postgres:16-alpine
container_name: anime-quiz-db
environment:
POSTGRES_USER: animequiz
POSTGRES_PASSWORD: animequiz123
POSTGRES_DB: animequiz
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
- "${DB_PORT}:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U animequiz"]
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
@@ -22,15 +22,20 @@ services:
context: ./backend
dockerfile: Dockerfile
container_name: anime-quiz-backend
ports:
- "8000:8000"
volumes:
- ./output:/app/output
env_file:
- .env
environment:
- QUIZ_OUTPUT_PATH=/app/output/videos
- DATABASE_URL=postgresql+asyncpg://animequiz:animequiz123@db:5432/animequiz
- DATABASE_URL=${DATABASE_URL}
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_REGION=${S3_REGION}
- S3_BUCKET=${S3_BUCKET}
- OUTPUT_PATH=${OUTPUT_PATH}
- TEMP_PATH=${TEMP_PATH}
- CACHE_PATH=${CACHE_PATH}
depends_on:
db:
condition: service_healthy
@@ -48,11 +53,11 @@ services:
dockerfile: Dockerfile
container_name: anime-quiz-frontend
ports:
- "5173:5173"
- "${APP_PORT}:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
environment:
- VITE_API_URL=http://backend:8000
restart: unless-stopped
volumes: