44 lines
1 KiB
YAML
44 lines
1 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: ${DB_NAME:-salary_benchmark}
|
|
POSTGRES_USER: ${DB_USER:-salary_user}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-salary_pass}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "5436:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-salary_user} -d ${DB_NAME:-salary_benchmark}"]
|
|
interval: 5s
|
|
retries: 5
|
|
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "8009:8000"
|
|
env_file: .env
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./app:/code/app
|
|
- ./alembic:/code/alembic
|
|
- ./alembic.ini:/code/alembic.ini
|
|
command: >
|
|
sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
|
|
|
|
frontend:
|
|
image: node:20-alpine
|
|
working_dir: /app
|
|
ports:
|
|
- "5179:5173"
|
|
volumes:
|
|
- ./frontend:/app
|
|
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
|
|
depends_on:
|
|
- app
|
|
|
|
volumes:
|
|
pgdata:
|