62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: cisco-builder-db
|
|
environment:
|
|
POSTGRES_USER: cisco_user
|
|
POSTGRES_PASSWORD: cisco_pass
|
|
POSTGRES_DB: cisco_builder
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U cisco_user"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# FastAPI Backend
|
|
api:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
container_name: cisco-builder-api
|
|
environment:
|
|
DATABASE_URL: postgresql://cisco_user:cisco_pass@postgres:5432/cisco_builder
|
|
SECRET_KEY: ${SECRET_KEY:-change-this-in-production}
|
|
DEBUG: "false"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ../backend:/app
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
|
|
# React Frontend
|
|
frontend:
|
|
build:
|
|
context: ../frontend
|
|
dockerfile: Dockerfile
|
|
container_name: cisco-builder-frontend
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
VITE_API_URL: http://localhost:8000
|
|
depends_on:
|
|
- api
|
|
volumes:
|
|
- ../frontend/src:/app/src
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
default:
|
|
name: cisco-builder-network
|