version: '1.0'
|
services:
|
#项目名称,用docker-compose做管理时,每个项目用这里配置的名称进行单独管理
|
## mysql
|
mysql-db:
|
# 指定容器的名称
|
container_name: mysql
|
# 指定镜像和版本
|
image: mysql:8.0
|
ports:
|
- "3306:3306"
|
restart: always
|
environment:
|
# 配置root密码
|
MYSQL_ROOT_PASSWORD: 123456
|
volumes:
|
# 挂载数据目录
|
- "/sda2/mysql/data:/var/lib/mysql"
|
# 挂载配置文件目录
|
- "/sda2/mysql/conf:/etc/mysql/conf.d"
|
## redis
|
redis:
|
image: redis:latest
|
container_name: redis
|
restart: always
|
ports:
|
- 6379:6379
|
volumes:
|
- ./redis-data:/data:rw
|
## nacos
|
nacos:
|
# 根据需要修改版本
|
image: nacos/nacos-server:2.3.2
|
container_name: nacos-standalone
|
restart: always
|
environment:
|
- PREFER_HOST_MODE=hostname
|
- MODE=standalone
|
volumes:
|
- ./nacos/logs/:/home/nacos/logs
|
- ./nacos/data/:/home/nacos/data
|
ports:
|
- "8848:8848"
|
depends_on:
|
- mysql
|
healthcheck:
|
test: ["CMD","curl","-f","http://localhost:8848/nacos"]
|
interval: 10s
|
timeout: 30s
|
retries: 3
|
## xxl-job
|
xxl-job:
|
# 根据需要修改版本
|
image: xxl-job:latest
|
container_name: xxl-job
|
restart: always
|
volumes:
|
- /sda2/iailab/iailab-plat/xxl-job/logs/:/data/applogs
|
ports:
|
- "9090:9090"
|
depends_on:
|
- mysql
|
# gateway:
|
# #镜像名,拉取镜像时也是用这个名字作为地址
|
# image: ic-gateway
|
# container_name: ic-gateway
|
# #打包路径,即docker build的路径
|
# build: ./api/gateway/
|
# restart: always
|
# #环境变量
|
# environment:
|
# CONFIG_SERVER: 172.19.188.43:8848 #配置中心地址
|
# #挂载目录
|
# volumes:
|
# - /etc/localtime:/etc/localtime:ro #时间同步
|
# - ./api/gateway-lib:/home/beex-gateway/lib
|
# - ./api/gateway/:/home/beex-gateway
|
# - ./logs:/logs
|
# #开放端口
|
# ports:
|
# - "9990:9000"
|
# - "9777:8777"
|
# networks:
|
# - 246-multi-tenant
|
# depends_on:
|
# nacos:
|
# condition: service_healthy
|
# healthcheck:
|
# test: ["CMD","curl","-S","http://localhost:9000/doc.html#/beex-api-gateway/authenticate-controller/authenticateUsingGET"]
|
# interval: 20s
|
# timeout: 30s
|
# retries: 3
|
# start_period: 20s
|