You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.3 KiB

version: '3.8'
services:
postgres:
image: timescale/timescaledb:latest-pg16
environment:
POSTGRES_DB: futures_data
POSTGRES_USER: futures
POSTGRES_PASSWORD: futures123
ports:
- "5432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U futures -d futures_data"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
backend:
build:
context: ./backend
dockerfile: ../Dockerfile.backend
ports:
- "8000:8000"
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: futures_data
DB_USER: futures
DB_PASSWORD: futures123
REDIS_HOST: redis
REDIS_PORT: 6379
TUSHARE_TOKEN: ${TUSHARE_TOKEN:-}
volumes:
- ./backend/app:/app/app
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: ../Dockerfile.frontend
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
volumes:
pg_data: