283 lines
7.0 KiB
YAML
283 lines
7.0 KiB
YAML
name: ${SERVICE_GROUP_NAME}
|
||
|
||
networks:
|
||
devkit:
|
||
name: ${NETWORK_NAME}
|
||
driver: bridge
|
||
ipam:
|
||
config:
|
||
- subnet: ${NETWORK_RANGE}
|
||
|
||
volumes:
|
||
pgadmin:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/pgadmin
|
||
rabbitmq:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/rabbitmq
|
||
portainer:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/portainer
|
||
mongo:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/mongo
|
||
minio:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/minio
|
||
postgres:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/postgres
|
||
redis:
|
||
driver: local
|
||
driver_opts:
|
||
type: none
|
||
o: bind
|
||
device: ./storage/redis
|
||
|
||
services:
|
||
# 主web入口服务,代理一切web
|
||
nginx:
|
||
image: quay.io/wandoubaba517/nginx:1.27
|
||
container_name: devkit_nginx
|
||
restart: always
|
||
volumes:
|
||
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
||
- ./nginx/conf/conf.d:/etc/nginx/conf.d
|
||
- ./nginx/conf/certs:/etc/nginx/certs
|
||
- ./nginx/conf/fastcgi_params:/etc/nginx/fastcgi_params
|
||
- ./nginx/conf/mime.types:/etc/nginx/mime.types
|
||
- ./nginx/conf/scgi_params:/etc/nginx/scgi_params
|
||
- ./nginx/conf/uwsgi_params:/etc/nginx/uwsgi_params
|
||
- ./nginx/html:/usr/share/nginx/html
|
||
working_dir: /usr/share/nginx/html
|
||
stdin_open: true
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
ports:
|
||
- ${NGINX_PORT}:80
|
||
depends_on:
|
||
rabbitmq:
|
||
condition: service_healthy
|
||
restart: true
|
||
minio:
|
||
condition: service_healthy
|
||
restart: true
|
||
|
||
# 容器可视化管理应用,被nginx代理
|
||
portainer:
|
||
image: quay.io/wandoubaba517/portainer-ce:2.20.3
|
||
container_name: devkit_portainer
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
volumes:
|
||
- portainer:/data
|
||
- /var/run/docker.sock:/var/run/docker.sock
|
||
|
||
# postgres数据库管理应用,被nginx代理
|
||
pgadmin:
|
||
image: quay.io/wandoubaba517/pgadmin4:8.9
|
||
container_name: devkit_pgadmin
|
||
environment:
|
||
PGADMIN_DEFAULT_EMAIL: hello@pg.com
|
||
PGADMIN_DEFAULT_PASSWORD: helloworld
|
||
volumes:
|
||
- ./pgadmin/servers.json:/pgadmin4/servers.json
|
||
- pgadmin:/var/lib/pgadmin
|
||
restart: always
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
|
||
depends_on:
|
||
postgres:
|
||
condition: service_healthy
|
||
restart: true
|
||
|
||
# postgres数据库
|
||
postgres:
|
||
image: quay.io/wandoubaba517/postgres:16.3
|
||
container_name: devkit_postgres
|
||
restart: always
|
||
environment:
|
||
POSTGRES_PASSWORD: helloworld
|
||
POSTGRES_USER: hello
|
||
POSTGRES_DB: hello
|
||
PGDATA: /data/pgdata
|
||
volumes:
|
||
- postgres:/data
|
||
- ./postgres/conf:/etc/postgres
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
command:
|
||
- postgres
|
||
- -c
|
||
- "config_file=/etc/postgres/postgresql.conf"
|
||
- -c
|
||
- "hba_file=/etc/postgres/pg_hba.conf"
|
||
- -c
|
||
- "ident_file=/etc/postgres/pg_ident.conf"
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U hello"]
|
||
interval: 15s
|
||
retries: 5
|
||
start_period: 15s
|
||
timeout: 10s
|
||
|
||
# mongodb的可视化应用,被nginx代理(不要求登录)
|
||
mongo-express:
|
||
image: quay.io/wandoubaba517/mongo-express:1.0.2
|
||
container_name: devkit_mongo-express
|
||
restart: always
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
environment:
|
||
ME_CONFIG_MONGODB_ADMINUSERNAME: hello
|
||
ME_CONFIG_MONGODB_ADMINPASSWORD: helloworld
|
||
ME_CONFIG_MONGODB_URL: mongodb://hello:helloworld@mongo:27017/
|
||
ME_CONFIG_BASICAUTH_USERNAME: hello
|
||
ME_CONFIG_BASICAUTH_PASSWORD: helloworld
|
||
ME_CONFIG_BASICAUTH: true
|
||
depends_on:
|
||
mongo:
|
||
condition: service_healthy
|
||
restart: true
|
||
|
||
# mongodb数据库
|
||
mongo:
|
||
image: quay.io/wandoubaba517/mongo:7.0
|
||
container_name: devkit_mongo
|
||
restart: always
|
||
environment:
|
||
TZ: Asia/Shanghai
|
||
MONGO_INITDB_ROOT_USERNAME: hello
|
||
MONGO_INITDB_ROOT_PASSWORD: helloworld
|
||
MONGO_INITDB_DATABASE: log
|
||
volumes:
|
||
- mongo:/data/db
|
||
- ./mongo/conf:/etc/mongo
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
command: ["mongod", "--config", "/etc/mongo/mongod.conf"]
|
||
healthcheck:
|
||
test:
|
||
["CMD-SHELL", 'mongosh -u hello -p helloworld --eval "db.stats().ok"']
|
||
interval: 20s
|
||
retries: 5
|
||
start_period: 15s
|
||
timeout: 10s
|
||
|
||
# redis缓存服务
|
||
redis:
|
||
image: quay.io/wandoubaba517/redis:7.2
|
||
container_name: devkit_redis
|
||
restart: always
|
||
volumes:
|
||
- redis:/data
|
||
- ./redis/conf:/etc/redis
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
command: ["redis-server", "/etc/redis/redis.conf"]
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "-a", "helloworld", "ping"]
|
||
interval: 15s
|
||
retries: 3
|
||
start_period: 15s
|
||
timeout: 10s
|
||
|
||
# minio对象存储服务
|
||
minio:
|
||
image: quay.io/minio/minio:RELEASE.2024-08-17T01-24-54Z
|
||
container_name: devkit_minio
|
||
restart: always
|
||
environment:
|
||
MINIO_CONFIG_ENV_FILE: /etc/config.env
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
volumes:
|
||
- minio:/mnt/data
|
||
- ./minio/config.env:/etc/config.env
|
||
command: server --console-address ':9001'
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||
interval: 20s
|
||
retries: 5
|
||
start_period: 15s
|
||
timeout: 10s
|
||
|
||
# rabbitmq消息队列服务
|
||
rabbitmq:
|
||
image: quay.io/wandoubaba517/rabbitmq:3.13.4
|
||
container_name: devkit_rabbitmq
|
||
restart: always
|
||
networks:
|
||
- ${NETWORK_NAME}
|
||
ports:
|
||
- 15672:15672
|
||
volumes:
|
||
- rabbitmq:/var/lib/rabbitmq/mnesia
|
||
- ./rabbitmq/conf/conf.d:/etc/rabbitmq/conf.d
|
||
healthcheck:
|
||
test: ["CMD", "rabbitmq-diagnostics", "check_running"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 5
|
||
start_period: 5s
|
||
|
||
# webman提供的web接口服务,提供http和ws服务,被nginx代理
|
||
# api:
|
||
# image: quay.io/wandoubaba517/workerman:8.1
|
||
# container_name: devkit_api
|
||
# restart: always
|
||
# volumes:
|
||
# - ./api/:/app/service
|
||
# - ./api/php.ini:/usr/local/etc/php/php.ini
|
||
# - /var/run/docker.sock:/var/run/docker.sock
|
||
# working_dir: /app/service
|
||
# stdin_open: true
|
||
# networks:
|
||
# - devkit
|
||
# ports:
|
||
# - 55601:55601
|
||
# - 55621:55621
|
||
# - 55631:55631
|
||
# command: ['php', 'start.php', 'start']
|
||
# healthcheck:
|
||
# test: ["CMD", "curl", "-f", "http://localhost:55601/"]
|
||
# interval: 5s
|
||
# retries: 3
|
||
# start_period: 5s
|
||
# timeout: 10s
|
||
# depends_on:
|
||
# es:
|
||
# condition: service_healthy
|
||
# restart: true
|
||
# postgres:
|
||
# condition: service_healthy
|
||
# restart: true
|
||
# mongo:
|
||
# condition: service_healthy
|
||
# restart: true
|
||
# redis:
|
||
# condition: service_healthy
|
||
# restart: true
|
||
# minio:
|
||
# condition: service_healthy
|
||
# restart: true
|