代码拉取完成,页面将自动刷新
同步操作将从 花森/huasenjio-compose 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# 版本号
version: "3"
# 自定义网络
networks:
# 网络名字
huasenNetwork:
# 网关驱动
driver: bridge
# 容器服务
services:
# 服务名称
mongo:
# 安装镜像
image: mongo:4.2.2
# 容器名称
container_name: mongo
restart: always
volumes:
# /data/db数据目录挂载到宿主机
- ./huasen-mongo/volume:/data/db
# 记录终端输出
- ./huasen-mongo/tail/null:/huasen-mongo/tail/null
# init-mongo-open.js 文件会在 mongodb 容器初始化完成之后执行,创建数据库默认的角色
- ./huasen-mongo/init-mongo-open.js:/docker-entrypoint-initdb.d/init-mongo-open.js
# 执行命令,windows 系统下,设置 15 秒的睡眠时间,避免 mongo 没有启动,执行初始化脚本失败
command: sh -c "mongod --bind_ip 0.0.0.0 & sleep 15 && mongo /docker-entrypoint-initdb.d/init-mongo-open.js && tail -f /huasen-mongo/tail/null"
environment:
# 设置时区为上海(东八区)
TZ: Asia/Shanghai
# 初始化mongodb的账户,账户创建在admin下,拥有超管权限
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: Mongo12345*
ports:
# 将容器的27017端口映射到宿主机的27017端口
- 37017:27017
networks:
# 设置网络
- huasenNetwork
redis:
image: redis:6.0.10-alpine
container_name: redis
restart: always
privileged: true
environment:
- TZ=Asia/Shanghai
ports:
- 7379:6379
# 挂载配置文件和数据
volumes:
- ./huasen-redis/conf/redis-open.conf:/usr/local/etc/redis/redis.conf
- ./huasen-redis/data:/data:rw
# 执行配置
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- huasenNetwork
nginx:
image: nginx:1.23.1
container_name: nginx
restart: always
volumes:
# 将容器中的nginx配置挂载到宿主机上对应的文件
- ./huasen-nginx/conf/nginx-open.conf:/etc/nginx/nginx.conf
- ./huasen-nginx/www:/home/www
- ./huasen-nginx/log:/var/log/nginx
- ./huasen-nginx/html:/usr/share/nginx/html
# 端口暴露
ports:
# - 80:80
- target: 80
published: 10088
protocol: tcp
mode: host
environment:
- TZ=Asia/Shanghai
networks:
- huasenNetwork
jenkins:
image: jenkins/jenkins:lts
container_name: jenkins
restart: always
privileged: true
user: root
volumes:
# 挂载目录到容器
- ./huasen-jenkins/:/var/jenkins_home
- ./huasen-jenkins-cache:/huasen-jenkins-cache
# 代理docker-compose到容器
- /usr/local/bin/docker-compose:/usr/local/bin/docker-compose
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7
ports:
- "8080:8080"
environment:
- TZ=Asia/Shanghai
networks:
- huasenNetwork
server:
# 指定Dockerflie构建镜像
build:
context: ./huasen-server
# 定义容器名称
container_name: server
restart: always
privileged: true
user: root
# 代理日志文件
volumes:
- ./huasen-log/:/app/huasen-server/log
- ./huasen-store/:/app/huasen-store
- ./huasen-server/setting.json:/app/huasen-server/setting.json
ports:
- "3000:3000"
- "8181:8181"
environment:
- TZ=Asia/Shanghai
depends_on:
- mongo
- redis
networks:
- huasenNetwork
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。