demo01/compose.yml

47 lines
1.1 KiB
YAML
Raw Normal View History

2023-10-20 11:44:43 +08:00
version: '3.9'
name: y9-dev-environments
services:
db:
image: mysql:latest
container_name: mysql01
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- y9-share-net
ports:
- "3306:3306"
command: --default-authentication-plugin=caching_sha2_password
environment:
MYSQL_ROOT_PASSWORD: '12345678'
MYSQL_DATABASE: 'y9_public'
volumes:
- d:/docker-data/mysql:/var/lib/mysql
- d:/docker-config/mysql-init:/docker-entrypoint-initdb.d
healthcheck:
#test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
test: "mysql --user=root --password=12345678 --execute='show databases;'"
interval: 5s
timeout: 10s
retries: 8
redis:
image: redis:latest
container_name: redis01
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- y9-share-net
ports:
- "6379:6379"
command: redis-server --requirepass "12345678"
volumes:
- d:/docker-data/redis:/data
networks:
y9-share-net:
external: true