Build Dockerized MVP scaffold and records importer
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: rf4_spotter
|
||||
POSTGRES_USER: rf4
|
||||
POSTGRES_PASSWORD: rf4_local
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U rf4 -d rf4_spotter"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
api:
|
||||
build: ./apps/api
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://rf4:rf4_local@db:5432/rf4_spotter
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8000:8000"
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
|
||||
web:
|
||||
build: ./apps/web
|
||||
environment:
|
||||
PUBLIC_API_URL: http://localhost:8000
|
||||
API_INTERNAL_URL: http://api:8000
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "4321:4321"
|
||||
|
||||
importer:
|
||||
build: ./apps/api
|
||||
profiles: ["tools"]
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://rf4:rf4_local@db:5432/rf4_spotter
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
command: ["sh", "-c", "alembic upgrade head && python -m app.cli import-records"]
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user