mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2025-12-06 13:54:41 +08:00
- Upgrade Dockerfile to Go 1.24 with multi-stage build (backend + frontend) - Add TA-Lib installation for technical analysis support - Integrate frontend build into main container image - Add Nginx reverse proxy configuration for API routing - Update docker-compose.yml to simplified single-container architecture - Update .dockerignore to include web source for build - Improve health checks and startup time handling Benefits: - One-click deployment with single Docker image - Better resource utilization with multi-stage build - Production-ready Nginx frontend serving - Easier maintenance and deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: tinkle-community <tinklefund@gmail.com>
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# NOFX Trading Backend
|
|
nofx:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: nofx-trading
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ./config.json:/app/config.json:ro
|
|
- ./decision_logs:/app/decision_logs
|
|
- /etc/localtime:/etc/localtime:ro # 同步主机时间
|
|
environment:
|
|
- TZ=Asia/Shanghai # 使用中国时区
|
|
networks:
|
|
- nofx-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
# Frontend (Nginx)
|
|
nofx-frontend:
|
|
image: nginx:alpine
|
|
container_name: nofx-frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:80"
|
|
volumes:
|
|
- ./web/dist:/usr/share/nginx/html:ro
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
networks:
|
|
- nofx-network
|
|
depends_on:
|
|
- nofx
|
|
|
|
networks:
|
|
nofx-network:
|
|
driver: bridge
|