Spaces:
Sleeping
Sleeping
| version: "3.9" | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| container_name: nl2sql_pg | |
| environment: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: demo | |
| volumes: | |
| - pgdata:/var/lib/postgresql/data | |
| - ./infra/migrate.sql:/docker-entrypoint-initdb.d/00_init.sql:ro | |
| ports: | |
| - "5432:5432" | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U postgres -d demo"] | |
| interval: 5s | |
| timeout: 3s | |
| retries: 10 | |
| api: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: nl2sql_api | |
| depends_on: | |
| postgres: | |
| condition: service_healthy | |
| environment: | |
| DB_MODE: postgres | |
| POSTGRES_DSN: dbname=demo user=postgres password=postgres host=postgres port=5432 | |
| OPENAI_MODEL_ID: gpt-4o-mini | |
| OPENAI_API_KEY: ${OPENAI_API_KEY} | |
| ports: | |
| - "8000:8000" | |
| command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"] | |
| volumes: | |
| pgdata: | |