3 Star 21 Fork 7

Big0range/vane

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml 1.88 KB
一键复制 编辑 原始数据 按行查看 历史
Big0range 提交于 2023-06-26 13:49 . feat: 🎸 123
version: '3.9'
services:
# node 服务
vane-server:
build: .
# depends_on:
# - mysql-master
# - mysql-node1
# - mysql-node2
# - redis-master
restart: always
container_name: vane-server
networks:
db_my_network:
ipv4_address: 172.16.238.200
logging:
options:
max-size: "100m"
max-file: "10"
image: vane-server
ports:
- 9999:9999
extra_hosts:
- "vane-mysql-master:172.16.238.2"
- "vane-mysql-node1:172.16.238.3"
- "vane-mysql-node2:172.16.238.4"
- "vane-redis-master:172.16.238.101"
volumes:
# 为了外部可以访问日志
- /home/docker-volumes/vane/logs:/app/server/logs
- /home/docker-volumes/vane/logs/.pm2:/root/.pm2/logs
# 为了nginx可以访问静态资源
- /home/docker-volumes/vane/nginx/html:/app/client/dist
# 共享 node_modules 要不每次容器启动都要重新安装依赖 太费时间了
- /opt/vane/node_modules:/app/node_modules
- /opt/vane/server/node_modules:/app/server/node_modules
- /opt/vane/client/node_modules:/app/client/node_modules
web:
image: nginx
depends_on:
- vane-server
restart: always
container_name: vane-nginx
networks:
db_my_network:
ipv4_address: 172.16.238.201
logging:
options:
max-size: "100m"
max-file: "10"
ports:
- 80:80
extra_hosts:
- "vane-server:172.16.238.200"
volumes:
# nginx配置文件
- "/home/docker-volumes/vane/nginx/conf:/etc/nginx"
# nginx日志
- "/home/docker-volumes/vane/nginx/logs:/var/log/nginx"
# 静态资源
- "/home/docker-volumes/vane/nginx/html:/usr/share/nginx"
networks:
# db 是数据库docker-compose所在文件夹的名称(就是此项目根目录下的db) my_network 是db自定义网络名称
db_my_network:
external: true
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li_mei_chao/vane.git
[email protected]:li_mei_chao/vane.git
li_mei_chao
vane
vane
master

搜索帮助