1.全量服务docker-compose.yml 的模板demo
version : '3.1'
services:
nacos:
image: nacos/nacos-server:1.4.1
container_name: nacos
environment:
- PREFER_HOST_MODE=ip
- MODE=standalone
- SPRING_DATASOURCE_PLATFORM=mysql
- MYSQL_SERVICE_HOST=192.168.19.145
- MYSQL_SERVICE_PORT=13306
- MYSQL_SERVICE_USER=root
- MYSQL_SERVICE_PASSWORD=root
- MYSQL_SERVICE_DB_NAME=guangrui_config
volumes:
- ./nacos/logs:/home/nacos/logs
ports:
- 8848:8848
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:8848/nacos/v1/console/health/readiness"]
interval: 10s
timeout: 3s
retries: 30
network_mode: host
upms:
container_name: upms
build:
context: ./km-upms/
dockerfile: Dockerfile
ports:
- "4000:4000"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4000/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
restart: always
auth:
container_name: auth
build:
context: ./km-auth/
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:3000/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
restart: always
tx:
container_name: tx
build:
context: ./km-tx/
dockerfile: Dockerfile
ports:
- "5004:5004"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:5004/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
gateway:
container_name: gateway
build:
context: ./km-gateway/
dockerfile: Dockerfile
ports:
- "9999:9999"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:9999/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
manage:
container_name: manage
build:
context: ./km-manage/
dockerfile: Dockerfile
ports:
- "4001:4001"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4001/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
pay:
container_name: pay
build:
context: ./km-pay/
dockerfile: Dockerfile
ports:
- "4009:4009"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4009/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
consult:
container_name: consult
build:
context: ./km-consult/
dockerfile: Dockerfile
ports:
- "4011:4011"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4011/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
ihos:
container_name: ihos
build:
context: ./km-ihos/
dockerfile: Dockerfile
ports:
- "4008:4008"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4008/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
restart: always
mall:
container_name: mall
build:
context: ./km-mall/
dockerfile: Dockerfile
ports:
- "4088:4088"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4088/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
assets:
container_name: assets
build:
context: ./km-assets/
dockerfile: Dockerfile
ports:
- "4010:4010"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4010/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30
pda:
container_name: pda
build:
context: ./km-pda/
dockerfile: Dockerfile
ports:
- "4111:4111"
environment:
- SPRING_PROFILES_ACTIVE=dev
volumes:
- ./logs/:/app/logs
network_mode: host
restart: always
healthcheck:
test: ["CMD", "curl" ,"http://127.0.0.1:4111/actuator/health/"]
interval: 10s
timeout: 3s
retries: 30