Introduce a `docker-compose.yml` to define the services for backend and database with health checks. Add Alembic configurations for database migrations and an initial empty migration. Include backend-related Docker setup with an entrypoint script for database migration execution.
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=eventspace
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
volumes:
|
|
- ./backend:/app
|
|
- ./uploads:/app/uploads
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://postgres:postgres@db:5432/eventspace
|
|
- SECRET_KEY=your_secret_key_here
|
|
- ENVIRONMENT=development
|
|
- DEBUG=true
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
# frontend:
|
|
# build:
|
|
# context: .
|
|
# dockerfile: frontend/Dockerfile
|
|
# volumes:
|
|
# - ./frontend:/app
|
|
# - /app/node_modules
|
|
# ports:
|
|
# - "3000:3000"
|
|
# environment:
|
|
# - NEXT_PUBLIC_API_URL=http://backend:8000
|
|
# depends_on:
|
|
# - backend
|
|
|
|
volumes:
|
|
postgres_data: |