64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
# 域名与 HTTPS 由 Nginx Proxy Manager 统一配置: https://npm.yuxindazhineng.com/nginx/proxy
|
||
# 本 compose 只暴露 9527(api)、9528(web)、9529(admin),由 NPM 反向代理到对外域名
|
||
version: "3.8"
|
||
|
||
services:
|
||
api:
|
||
build:
|
||
context: .
|
||
dockerfile: server/Dockerfile
|
||
image: yh_web-api:latest
|
||
container_name: yh_api
|
||
environment:
|
||
- PORT=9527
|
||
- MONGODB_URI=${MONGODB_URI:-mongodb://mongo:27017}
|
||
- MONGODB_DB=${MONGODB_DB:-yxd-agent-testing}
|
||
- GIN_MODE=release
|
||
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-https://yuheng.yuxindazhineng.com}
|
||
depends_on:
|
||
- mongo
|
||
networks:
|
||
- yh_net
|
||
ports:
|
||
- "9527:9527"
|
||
|
||
web:
|
||
build:
|
||
context: ./web
|
||
dockerfile: Dockerfile
|
||
image: yh_web-web:latest
|
||
container_name: yh_web
|
||
networks:
|
||
- yh_net
|
||
ports:
|
||
- "9528:80"
|
||
|
||
admin:
|
||
build:
|
||
context: ./admin
|
||
dockerfile: Dockerfile
|
||
image: yh_web-admin:latest
|
||
container_name: yh_admin
|
||
networks:
|
||
- yh_net
|
||
ports:
|
||
- "9529:80"
|
||
|
||
mongo:
|
||
image: mongo:7
|
||
container_name: yh_mongo
|
||
volumes:
|
||
- mongo_data:/data/db
|
||
networks:
|
||
- yh_net
|
||
# 仅内网,不暴露端口(API 容器内用 mongo:27017)
|
||
# ports:
|
||
# - "27017:27017"
|
||
|
||
networks:
|
||
yh_net:
|
||
driver: bridge
|
||
|
||
volumes:
|
||
mongo_data:
|