Files
rezept_finder/docker-compose.yml
T
2026-06-10 11:19:39 +02:00

59 lines
1.7 KiB
YAML

services:
postgres:
image: postgres:16
container_name: rezept_finder_postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-rezept_finder}
POSTGRES_USER: ${POSTGRES_USER:-rezept_finder}
POSTGRES_PASSWORD: ${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:
APP_DOMAIN: ${APP_DOMAIN:-http://localhost:5173}
DATABASE_URL: ${DATABASE_URL:-postgresql+psycopg2://rezept_finder:rezept_finder@postgres:5432/rezept_finder}
FRONTEND_ORIGIN: ${FRONTEND_ORIGIN:-http://localhost:5173}
SECRET_KEY: ${SECRET_KEY:-dev-secret}
SOCKETIO_PATH: ${SOCKETIO_PATH:-/api/socket.io}
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_BASE: ${VITE_API_BASE:-/api}
VITE_SOCKET_PATH: ${VITE_SOCKET_PATH:-/api/socket.io}
VITE_DEV_API_TARGET: ${VITE_DEV_API_TARGET:-http://backend:5000}
ports:
- "5173:5173"
volumes:
- ./frontend:/app:Z
- frontend_node_modules:/app/node_modules
depends_on:
- backend
volumes:
postgres_data:
frontend_node_modules: