app v1
This commit is contained in:
60
docker-compose.yml
Normal file
60
docker-compose.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: anime-quiz-db
|
||||
environment:
|
||||
POSTGRES_USER: animequiz
|
||||
POSTGRES_PASSWORD: animequiz123
|
||||
POSTGRES_DB: animequiz
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U animequiz"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build:
|
||||
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
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: anime-quiz-frontend
|
||||
ports:
|
||||
- "5173:5173"
|
||||
depends_on:
|
||||
- backend
|
||||
environment:
|
||||
- VITE_API_URL=http://backend:8000
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
output:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user