From a80d4df8dcbdaf5f27dd798afcf209686cb93469 Mon Sep 17 00:00:00 2001 From: administrator Date: Tue, 12 Mar 2024 17:05:30 +0800 Subject: [PATCH] Update roles/demolamp/files/demolamp.tpl --- roles/demolamp/files/demolamp.tpl | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/roles/demolamp/files/demolamp.tpl b/roles/demolamp/files/demolamp.tpl index e69de29..98d71e9 100644 --- a/roles/demolamp/files/demolamp.tpl +++ b/roles/demolamp/files/demolamp.tpl @@ -0,0 +1,108 @@ +version: '3.9' +services: + nginx: + image: nginx:{{ ansTagVer }} + ports: + - 80:80 + environment: + NGINX_HOST: php-fpm + volumes: + - type: volume + source: nfs_html + target: /usr/share/nginx/html + volume: + nocopy: true + - type: volume + source: nfs_conf + target: /etc/nginx + volume: + nocopy: true + deploy: +# mode: replicated +# replicas: 2 + mode: global + placement: + constraints: + - node.labels.appdemo != false + update_config: + parallelism: 1 + delay: 10s + resources: + limits: + cpus: '0.4' + memory: 100M + reservations: + cpus: '0.2' + memory: 50M + depends_on: + - php-fpm + networks: + - lnmp-demo + + php-fpm: + image: php:{{ ansTagVer }} + ports: + - 9000:9000 + volumes: + - type: volume + source: php_html + target: /var/www/html + volume: + nocopy: true + - type: volume + source: php_conf + target: /usr/local/etc + volume: + nocopy: true + networks: + - lnmp-demo + deploy: +# mode: replicated +# replicas: 2 + mode: global + placement: + constraints: + - node.labels.appdemo != false + resources: + limits: + cpus: '0.8' + memory: 100M + reservations: + cpus: '0.5' + memory: 50M + +volumes: + nfs_html: + driver: local + driver_opts: + type: "nfs" + o: "addr=192.168.11.121,vers=4,soft,timeo=180,bg,tcp,rw" + device: "192.168.11.121:/nginxhtml" + nfs_conf: + driver: local + driver_opts: + type: "nfs" + o: "addr=192.168.11.121,vers=4,soft,timeo=180,bg,tcp,rw" + device: "192.168.11.121:/nginxconf" + php_html: + driver: local + driver_opts: + type: "nfs" + o: "addr=192.168.11.121,vers=4,soft,timeo=180,bg,tcp,rw" + device: "192.168.11.121:/phphtml" + php_conf: + driver: local + driver_opts: + type: "nfs" + o: "addr=192.168.11.121,vers=4,soft,timeo=180,bg,tcp,rw" + device: "192.168.11.121:/phpconf" + +#networks: +# lnmp-demo: +# external: true +# name: lnmp-demo + +networks: + lnmp-demo: + driver: overlay +# external: true