Files
stock-info-crawler/docker-compose.yml
MH Hung 099f156e6f feat(email): add SMTP security modes (starttls/ssl/none) with sensible default ports; add /notify_test endpoint; support ALWAYS_NOTIFY_ON_STARTUP to force first-run notification
chore(docker): run enhanced_crawler.py as entrypoint

ops(compose): load env via env_file and remove hardcoded secrets

docs: update README and .env.template for SMTP and startup notification
2025-09-03 21:32:50 +08:00

37 lines
838 B
YAML

# docker-compose.yml
version: '3.8'
services:
barrons-crawler:
build: .
container_name: barrons-crawler
restart: unless-stopped
# 將同目錄的 .env 檔注入容器環境變數
env_file:
- .env
# 所有環境變數由 .env 提供
volumes:
- ./data:/app/data # 資料持久化
- ./logs:/app/logs # 日誌持久化
ports:
- "8080:8080" # 健康檢查和狀態 API
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 可選:加入 Redis 用於快取
redis:
image: redis:7-alpine
container_name: barrons-redis
restart: unless-stopped
volumes:
- redis_data:/data
command: redis-server --appendonly yes
volumes:
redis_data: