version: "3.8"
|
services:
|
# postgis
|
postgis:
|
image: postgis/postgis:17.5
|
ports:
|
- 5432:5432
|
volumes:
|
- ./postgis/pgdata:/var/lib/postgresql/data
|
- ./postgis/init:/docker-entrypoint-initdb.d
|
environment:
|
POSTGRES_USER: postgres
|
POSTGRES_PASSWORD: Postgres!_17_jHs
|
ALLOW_IP_RANGE: 0.0.0.0/0
|
TZ: Asia/Shanghai
|
POSTGRES_DB: jhs
|
healthcheck:
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
interval: 10s
|
timeout: 2s
|
retries: 3
|
privileged: true
|
networks:
|
- network-jhs
|
# nacos
|
nacos:
|
image: nacos/nacos-server:v3.0.2
|
environment:
|
TZ: Asia/Shanghai
|
MODE: standalone
|
SPRING_DATASOURCE_PLATFORM: postgresql
|
DB_URL: jdbc:postgresql://postgis:5432/jhs?tcpKeepAlive=true&reWriteBatchedInserts=true&ApplicationName=nacos_java
|
DB_USER: postgres
|
DB_PASSWORD: Postgres!_17_jHs
|
NACOS_AUTH_ENABLE: true
|
NACOS_AUTH_IDENTITY_KEY: nacos
|
NACOS_AUTH_IDENTITY_VALUE: nAcos_!9#_admIn
|
DB_POOL_CONFIG_DRIVERCLASSNAME: org.postgresql.Driver
|
NACOS_AUTH_TOKEN: TmFjb3NfUmFuZG9tX1N0cmluZ18zMl9DaGFyc19Pcl9Mb25nZXI=
|
volumes:
|
- ./nacos/logs/:/home/nacos/logs
|
- ./nacos/plugins:/home/nacos/plugins
|
#- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
healthcheck:
|
test: ["CMD-SHELL", "curl -f http://localhost:8080 || exit 1"]
|
interval: 10s
|
timeout: 2s
|
retries: 3
|
start_period: 7s
|
ports:
|
- 8080:8080
|
- 8848:8848
|
- 9848:9848
|
depends_on:
|
postgis:
|
condition: service_healthy
|
privileged: true
|
networks:
|
- network-jhs
|
#restart: always
|
# redis
|
redis:
|
image: redis:7
|
ports:
|
- 6379:6379
|
volumes:
|
- ./redis/redis.conf:/data/redis.conf
|
- ./redis/data:/data
|
healthcheck:
|
test: ["CMD", "redis-cli", "ping"]
|
interval: 10s
|
timeout: 2s
|
retries: 3
|
#command: redis-server --requirepass Redis_s!E_6.2.6
|
command: redis-server /data/redis.conf
|
networks:
|
- network-jhs
|
# gateway
|
gateway:
|
image: openjdk:8-jre
|
volumes:
|
- ./gateway/logs:/logs
|
- ./gateway:/app
|
environment:
|
TZ: Asia/Shanghai
|
#entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-gateway.jar --spring.config.location=file:/app/"
|
entrypoint: java -jar /app/se-gateway.jar --spring.config.location=file:/app/
|
depends_on:
|
redis:
|
condition: service_healthy
|
nacos:
|
condition: service_healthy
|
networks:
|
- network-jhs
|
# system
|
system:
|
image: openjdk8-422-gdal:3.5.2
|
volumes:
|
- ./system/logs:/logs
|
- ./system:/app
|
environment:
|
TZ: Asia/Shanghai
|
#entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-system.jar --spring.config.location=file:/app/"
|
entrypoint: java -jar /app/se-system.jar --spring.config.location=file:/app/
|
depends_on:
|
postgis:
|
condition: service_healthy
|
redis:
|
condition: service_healthy
|
nacos:
|
condition: service_healthy
|
networks:
|
- network-jhs
|
# nginx
|
nginx:
|
image: nginx:1.29
|
ports:
|
- 80:80
|
- 443:443
|
environment:
|
TZ: Asia/Shanghai
|
volumes:
|
- ./nginx/logs:/var/log/nginx
|
- ./nginx/html:/usr/share/nginx/html
|
- ./nginx/conf/conf.d:/etc/nginx/conf.d
|
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
depends_on:
|
- gateway
|
- system
|
networks:
|
- network-jhs
|
networks:
|
network-jhs:
|
driver: bridge
|