mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 01:48:22 +08:00
chore: add environment variable support and enhance startup script
- Add .env.example template for configurable Docker deployment settings - Update docker-compose.yml to support environment-driven port/timezone configuration - Refactor start.sh with improved Docker Compose detection, environment validation, and automated frontend building - Enhance script documentation and error handling for better maintainability
This commit is contained in:
+3
-3
@@ -9,13 +9,13 @@ services:
|
||||
container_name: nofx-trading
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "${NOFX_BACKEND_PORT:-8080}:8080"
|
||||
volumes:
|
||||
- ./config.json:/app/config.json:ro
|
||||
- ./decision_logs:/app/decision_logs
|
||||
- /etc/localtime:/etc/localtime:ro # 同步主机时间
|
||||
environment:
|
||||
- TZ=Asia/Shanghai # 使用中国时区
|
||||
- TZ=${NOFX_TIMEZONE:-Asia/Shanghai} # 使用中国时区
|
||||
networks:
|
||||
- nofx-network
|
||||
healthcheck:
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
container_name: nofx-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:80"
|
||||
- "${NOFX_FRONTEND_PORT:-3000}:80"
|
||||
volumes:
|
||||
- ./web/dist:/usr/share/nginx/html:ro
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
|
||||
Reference in New Issue
Block a user