swarm
This commit is contained in:
42
docker-swarm/mysql/docker-compose.yml
Normal file
42
docker-swarm/mysql/docker-compose.yml
Normal file
@ -0,0 +1,42 @@
|
||||
version: '3.8'
|
||||
networks:
|
||||
default:
|
||||
name: ${NAMESPACE}
|
||||
external: true
|
||||
services:
|
||||
db:
|
||||
image: docker.io/bitnami/mysql:8.0
|
||||
ports:
|
||||
- '${NODE_PORT}:3306'
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_ENABLE_SLOW_QUERY=0
|
||||
- MYSQL_LONG_QUERY_TIME=10
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password
|
||||
volumes:
|
||||
- 'data_db:/bitnami/mysql/data'
|
||||
healthcheck:
|
||||
test: ['CMD', '/opt/bitnami/scripts/mysql/healthcheck.sh']
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
configs:
|
||||
- source: custome_config
|
||||
target: /opt/bitnami/mysql/conf/my_custom.cnf
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.${NAMESPACE}_mysql==1
|
||||
volumes:
|
||||
data_db:
|
||||
driver: local
|
||||
configs:
|
||||
custome_config:
|
||||
external: true
|
||||
name: ${CUSTOME_CONFIG}
|
||||
|
||||
|
Reference in New Issue
Block a user