Files
fast-next-template/docker-compose.yml
Felipe Cardoso 481b6d618e Refactor and reorganize Alembic and database configuration.
Moved Alembic files into the `app/alembic` directory and updated related paths. Consolidated database configuration in `config.py`, leveraging environment variables and ensuring centralized management. Updated Docker Compose to include `.env` files, providing a more consistent environment setup.
2025-02-28 09:26:25 +01:00

60 lines
1.3 KiB
YAML

services:
db:
image: postgres:17-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- app-network
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: production
env_file:
- .env
environment:
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}
- ENVIRONMENT=production
- DEBUG=false
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
depends_on:
db:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: runner
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
depends_on:
- backend
networks:
- app-network
restart: unless-stopped
volumes:
postgres_data:
networks:
app-network:
driver: bridge