stock-monitor/docker/docker-compose.yml
2025-11-17 10:21:33 +08:00

55 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
services:
stock-monitor:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: stock-monitor
ports:
- "8000:8000"
volumes:
- ../logs:/app/logs
- ../data:/app/data
- ../config.json:/app/config.json
environment:
- PYTHONUNBUFFERED=1
restart: unless-stopped
networks:
- stock-network
# 可选添加Redis缓存服务
redis:
image: redis:7-alpine
container_name: stock-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
networks:
- stock-network
# 可选添加PostgreSQL数据库
postgres:
image: postgres:15-alpine
container_name: stock-postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: stock_monitor
POSTGRES_USER: stock_user
POSTGRES_PASSWORD: stock_password
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
networks:
- stock-network
networks:
stock-network:
driver: bridge
volumes:
redis_data:
postgres_data: