Files
web/docker-compose.yml

84 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 对外仅暴露 443HTTPS内部 api/web/admin 不映射宿主机端口
# version 已废弃,已移除
services:
api:
build:
context: .
dockerfile: server/Dockerfile
args:
GOPROXY: ${GOPROXY:-https://goproxy.cn,direct}
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-}
image: yh_web-api:latest
container_name: yh_api
environment:
# PORT=8088 仅容器内监听,不映射到宿主机(无 ports 配置)
- PORT=8088
- 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
# 不暴露宿主机端口,仅由 nginx 容器反代
web:
build:
context: ./web
dockerfile: Dockerfile
args:
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-}
image: yh_web-web:latest
container_name: yh_web
networks:
- yh_net
# 不暴露宿主机端口,仅由 nginx 容器反代
admin:
build:
context: ./admin
dockerfile: Dockerfile
args:
REGISTRY_MIRROR: ${REGISTRY_MIRROR:-}
image: yh_web-admin:latest
container_name: yh_admin
networks:
- yh_net
# 不暴露宿主机端口,仅由 nginx 容器反代
nginx:
image: ${REGISTRY_MIRROR:-docker.m.daocloud.io/library/}nginx:alpine
container_name: yh_nginx
ports:
- "443:443"
volumes:
- ./nginx/yuheng.docker.conf:/etc/nginx/conf.d/default.conf:ro
- /etc/ssl/yh_web/yuheng.yuxindazhineng.com:/etc/ssl/yh_web/yuheng.yuxindazhineng.com:ro
depends_on:
- api
- web
- admin
networks:
- yh_net
mongo:
# 国内默认走镜像;海外可 export REGISTRY_MIRROR= 后直连
image: ${REGISTRY_MIRROR:-docker.m.daocloud.io/library/}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: