54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: wealthwise-db
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: wealthwise
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- wealthwise-network
|
|
|
|
# FastAPI Backend
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: wealthwise-backend
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/wealthwise
|
|
SECRET_KEY: ${SECRET_KEY:-your-super-secret-key-change-in-production}
|
|
ALGORITHM: HS256
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: 30
|
|
DEBUG: "false"
|
|
PROJECT_NAME: WealthWise
|
|
API_V1_STR: /api/v1
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- .:/app
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
networks:
|
|
- wealthwise-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
wealthwise-network:
|
|
driver: bridge |