coding 发表于 2018-8-23 18:30:39

docker swarm 搭建 Lnmp docker-compose.yml 我已经写好!

完成也正是下面这张图后面我还会在更新jenkins 部份现在 更新LNMP 中得   NP   nginx    php-fpm

https://www.iyunv.com/data/attachment/forum/201804/25/221053dz65u6bp0n6dwtrw.png
version: '3.2'
services:
nginx:
    image: 172.16.0.199:5000/nginx:v1.0
    ports:
      - 80:80
    environment:
      NGINX_HOST: php-fpm
    volumes:
      - type: volume
      source: webdata
      target: /usr/www/html
      volume:
          nocopy: true
    deploy:
      mode: replicated
      replicas: 3
      resources:
      limits:
          cpus: '0.4'
          memory: 100M
      reservations:
          cpus: '0.2'
          memory: 50M
    depends_on:
      - php-fpm
    networks:
      - stack_net
      
php-fpm:
    image: 172.16.0.199:5000/php-fpm:v1.0
    volumes:
      - type: volume
      source: webdata
      target: /usr/www/html
      volume:
          nocopy: true
    networks:
       - stack_net
    deploy:
      mode: replicated
      replicas: 2
      resources:
      limits:
          cpus: '0.8'
          memory: 100M
      reservations:
          cpus: '0.5'
          memory: 50M
volumes:
webdata:
    driver: local
    driver_opts:
      type: "nfs"
      o: "addr=172.16.0.40,vers=4,soft,timeo=180,bg,tcp,rw"
      device: "172.16.0.40:/data/www"

networks:
stack_net:
    driver: overlay


在swarm-master 端运行   docker stack deploy -c ./docker-lanmp.yamldem
RUN:   docker stack deploy -c my-demo
最终效果图:
https://images2018.cnblogs.com/blog/1183797/201808/1183797-20180812190100803-350920523.pnghttps://images2018.cnblogs.com/blog/1183797/201808/1183797-20180812190010560-246835392.png

cheng029 发表于 2018-8-23 20:19:23

期待jenkins的更新

only 发表于 2018-8-24 09:20:22

厉害了

zhy1022wo 发表于 2018-8-29 11:10:28

赞!
页: [1]
查看完整版本: docker swarm 搭建 Lnmp docker-compose.yml 我已经写好!