|
|
@@ -4,21 +4,30 @@ services:
|
|
|
context: .
|
|
|
dockerfile: Dockerfile
|
|
|
args:
|
|
|
- # 构建参数(非敏感数据)
|
|
|
SOL_ENDPOINT: ${SOL_ENDPOINT:-}
|
|
|
container_name: byreal-table
|
|
|
- ports:
|
|
|
- - '80:3000'
|
|
|
+ # 不要再映射 80:3000,改成内部用的 3000 端口(也可以直接去掉 ports,用 expose)
|
|
|
+ expose:
|
|
|
+ - '3000'
|
|
|
environment:
|
|
|
- # 运行时环境变量(从 .env 文件读取)
|
|
|
- SOL_ENDPOINT=${SOL_ENDPOINT}
|
|
|
- SOL_SECRET_KEY=${SOL_SECRET_KEY}
|
|
|
- NODE_ENV=production
|
|
|
- NEXT_TELEMETRY_DISABLED=1
|
|
|
restart: unless-stopped
|
|
|
- # 如果需要持久化数据,可以取消注释以下配置
|
|
|
- # volumes:
|
|
|
- # - ./data:/app/data
|
|
|
+ networks:
|
|
|
+ - byreal-network
|
|
|
+
|
|
|
+ nginx:
|
|
|
+ image: nginx:alpine
|
|
|
+ container_name: byreal-nginx
|
|
|
+ depends_on:
|
|
|
+ - byreal-table
|
|
|
+ ports:
|
|
|
+ - '80:80'
|
|
|
+ volumes:
|
|
|
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
|
+ - ./htpasswd:/etc/nginx/.htpasswd:ro
|
|
|
networks:
|
|
|
- byreal-network
|
|
|
|