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.
buffer_platform/docker-compose.yml

51 lines
1.3 KiB

services:
buffer-platform:
build:
context: .
dockerfile: Dockerfile
container_name: futures-buffer-platform
restart: unless-stopped
ports:
- "9600:8600"
environment:
- BUFFER_DB_PATH=/app/data/buffer.db
- BUFFER_HOST=0.0.0.0
- BUFFER_PORT=8600
- CACHE_TTL=300
- BUFFER_LOG_LEVEL=INFO
- MAX_WORKERS=2
- TZ=Asia/Shanghai
- REDIS_HOST=192.168.0.222
- REDIS_PORT=6379
- REDIS_DB=0
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- REDIS_TTL_SECONDS=${REDIS_TTL_SECONDS:-2592000}
- MYSQL_HOST=192.168.0.222
- MYSQL_PORT=3306
- MYSQL_USER=root
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-1qazse42W3}
- MYSQL_DATABASE=${MYSQL_DATABASE:-buffer_platform}
volumes:
# 数据持久化 - SQLite数据库
- ./data:/app/data
# 静态文件(开发模式,生产环境应该打包到镜像中)
- ./app/static:/app/app/static
# 日志持久化(可选)
- ./logs:/app/logs
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8600/api/v1/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- futures-network
networks:
futures-network:
driver: bridge
volumes:
redis-data:
mysql-data: