标签:node 利用 mod mes word docer oba controls class
docker-compose文件
version: ‘3.1‘ services: web: image: wordpress ports: - 8080:80 secrets: - my-pw environment: WORDPRESS_DB_HOST: mysql WORDPRESS_DB_PASSWORD_FILE: /run/secrets/my-pw networks: - my-network depends_on: - mysql deploy: mode: replicated replicas: 3 restart_policy: condition: on-failure delay: 5s max_attempts: 3 update_config: parallelism: 1 delay: 10s mysql: image: mysql secrets: - my-pw environment: MYSQL_ROOT_PASSWORD_FILE: /run/secrets/my-pw MYSQL_DATABASE: wordpress volumes: - mysql-data:/var/lib/mysql networks: - my-network deploy: mode: global placement: constraints: - node.role == manager volumes: mysql-data: networks: my-network: driver: overlay secrets: my-pw: external: true
创建secret
echo "password" | docer secret create my-pw - (也可用docker secret create my-pw password)
直接运行docker stack
docker stack create wordpress -c=docker-compose.yml
docker stack利用secrets启动wordpress
标签:node 利用 mod mes word docer oba controls class
原文地址:https://www.cnblogs.com/soymilk2019/p/11610715.html