sol-cloud/docker/infra.docker-compose.yml

117 lines
No EOL
3.2 KiB
YAML

networks:
cloud-app:
external: true
volumes:
pg-data:
external: true
redis-data:
external: true
services:
# Nacos
cloud-app-nacos:
image: nacos/nacos-server:v2.5.1
container_name: cloud-app-nacos
restart: unless-stopped
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
environment:
TZ: ${TZ}
MODE: standalone
NACOS_APPLICATION_PORT: 8848
DB_SERVICE_NAME: postgresql
DB_SERVICE_HOST: cloud-app-postgres
DB_SERVICE_PORT: 5432
DB_SERVICE_DB_NAME: nacos
DB_SERVICE_USER: ${POSTGRES_USER}
DB_SERVICE_PASSWORD: ${POSTGRES_PASSWORD}
NACOS_AUTH_ENABLE: true
NACOS_AUTH_TOKEN: ${NACOS_AUTH_TOKEN}
NACOS_AUTH_IDENTITY_KEY: ${NACOS_AUTH_IDENTITY_KEY}
NACOS_AUTH_IDENTITY_VALUE: ${NACOS_AUTH_IDENTITY_SECRET}
networks:
- cloud-app
volumes:
- ./data/nacos/logs:/home/nacos/logs
- ./config/nacos/conf/application.properties:/home/nacos/conf/application.properties
- ./config/nacos/plugins/:/home/nacos/plugins/
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8848/nacos/v1/console/namespaces?&namespaceId=" ]
interval: 10s
timeout: 5s
retries: 3
# Minio 服务
cloud-app-minio:
image: minio/minio:RELEASE.2024-11-07T00-52-20Z
container_name: cloud-app-minio
restart: unless-stopped
command:
- server
- /data
- --console-address
- :9001
ports:
- "9000:9000"
- "9001:9001"
environment:
TZ: ${TZ}
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- ./data/minio/data:/data
- ./data/minio/root/.minio:/root/.minio
networks:
- cloud-app
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 10s
timeout: 5s
retries: 3
# PostgreSQL 数据库服务
cloud-app-postgres:
image: postgres:17.2
container_name: cloud-app-postgres
restart: unless-stopped
command: postgres -c config_file=/etc/postgresql/postgresql.conf
environment:
TZ: ${TZ}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- pg-data:/var/lib/postgresql/data
- ./data/postgres/log:/var/log/postgresql
- ./config/postgres/initdb:/docker-entrypoint-initdb.d:ro
- ./config/postgres/conf/postgresql.conf:/etc/postgresql/postgresql.conf:ro
ports:
- "5432:5432"
networks:
- cloud-app
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 10s
timeout: 5s
retries: 3
# Redis 服务
cloud-app-redis:
image: redis:7.4.2
container_name: cloud-app-redis
restart: unless-stopped
environment:
TZ: ${TZ}
REDIS_PASSWORD: ${REDIS_PASSWORD}
command:
- /bin/sh
- -c
- redis-server --maxmemory 8gb --maxmemory-policy allkeys-lru --appendonly yes --requirepass $$REDIS_PASSWORD
volumes:
- redis-data:/data
ports:
- "6379:6379"
networks:
- cloud-app
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3