xfg-ddd/docs/dev-ops/docker-compose-environment-aliyun.yml

87 lines
2.2 KiB
YAML
Raw Normal View History

# 命令执行 docker-compose -f docker-compose-environment-aliyun.yml up -d
# docker 代理和使用文档https://bugstack.cn/md/road-map/docker.html
version: '3.9'
services:
mysql:
image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/mysql:8.0.32
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
ports:
- "13306:3306"
volumes:
- ./mysql/sql:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
networks:
- my-network
# phpmyadmin https://hub.docker.com/_/phpmyadmin
phpmyadmin:
image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/phpmyadmin:5.2.1
container_name: phpmyadmin
hostname: phpmyadmin
ports:
- 8899:80
environment:
- PMA_HOST=mysql
- PMA_PORT=3306
- MYSQL_ROOT_PASSWORD=123qwe!@#QWE
depends_on:
mysql:
condition: service_healthy
networks:
- my-network
# Redis
redis:
image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/redis:6.2
container_name: redis
restart: always
hostname: redis
privileged: true
ports:
- 16379:6379
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- my-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
# RedisAdmin https://github.com/joeferner/redis-commander
# 账密 admin/admin
redis-admin:
image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/redis-commander:0.8.0
container_name: redis-admin
hostname: redis-commander
restart: always
ports:
- 8081:8081
environment:
- REDIS_HOSTS=local:redis:6379
- HTTP_USER=admin
- HTTP_PASSWORD=admin
- LANG=C.UTF-8
- LANGUAGE=C.UTF-8
- LC_ALL=C.UTF-8
networks:
- my-network
depends_on:
redis:
condition: service_healthy
networks:
my-network:
driver: bridge