55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: rezept_finder_postgres
|
|
environment:
|
|
POSTGRES_DB: rezept_finder
|
|
POSTGRES_USER: rezept_finder
|
|
POSTGRES_PASSWORD: rezept_finder
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U rezept_finder -d rezept_finder"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
container_name: rezept_finder_backend
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg2://rezept_finder:rezept_finder@postgres:5432/rezept_finder
|
|
FRONTEND_ORIGIN: http://localhost:5173
|
|
SECRET_KEY: dev-secret
|
|
ports:
|
|
- "5000:5000"
|
|
volumes:
|
|
- ./backend:/app:Z
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command: >
|
|
sh -c "python -c 'from app import create_app; from app.models import db; app = create_app(); ctx = app.app_context(); ctx.push(); db.create_all()'
|
|
&& python run.py"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
container_name: rezept_finder_frontend
|
|
environment:
|
|
VITE_API_URL: http://localhost:5000
|
|
ports:
|
|
- "5173:5173"
|
|
volumes:
|
|
- ./frontend:/app:Z
|
|
- frontend_node_modules:/app/node_modules
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
postgres_data:
|
|
frontend_node_modules:
|