47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:18.3-alpine3.23
|
|
environment:
|
|
POSTGRES_USER: trade
|
|
POSTGRES_PASSWORD: trade
|
|
POSTGRES_DB: futures
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U trade -d futures"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
tushare:
|
|
build: ./tushare
|
|
env_file: ./tushare/.env
|
|
environment:
|
|
- DATABASE_URL=postgresql://trade:trade@postgres:5432/futures
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8000:8000"
|
|
command: ["uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
web:
|
|
build:
|
|
context: ./web
|
|
dockerfile: backend/Dockerfile
|
|
env_file: ./web/backend/.env
|
|
environment:
|
|
- LISTEN_ADDR=:8080
|
|
- DATABASE_URL=postgres://trade:trade@postgres:5432/futures?sslmode=disable
|
|
- AUTH_DB_PATH=/app/auth/auth.db
|
|
depends_on:
|
|
- postgres
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ./data:/app/auth
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|