From 7bd8205af91f2340c115e5ace85aabf6d48a61ee Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 4 Mar 2022 14:33:31 +0200 Subject: [PATCH] add cloud info --- .../modules/ROOT/pages/docker-compose.adoc | 138 ++---------------- 1 file changed, 16 insertions(+), 122 deletions(-) diff --git a/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc b/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc index 9918e3e..2cf6309 100644 --- a/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc +++ b/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc @@ -6,15 +6,16 @@ [source,yaml] ---- services: - minio1: //<1> - image: minio/minio:RELEASE.2020-04-10T03-34-42Z //<2> - hostname: minio1 + myapp: //<1> + image: node:8.2.1-alpine //<2> + hostname: myapp volumes: - - minio1-data:/export //<3> + - /PATH_to_app/app.js:/code/app.js //<3> + - /PATH_to_app/index.html:/code/index.html //<3> ports: - - "9001:9000" //<4> + - "8000:8000" //<4> networks: - - minio_distributed //<5> + - mynet //<5> deploy: restart_policy: delay: 10s @@ -22,99 +23,9 @@ services: window: 60s placement: constraints: - - node.labels.minio1==true //<6> - command: server http://minio{1...4}/export //<7> - secrets: //<8> - - secret_key - - access_key - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] //<9> - interval: 30s - timeout: 20s - retries: 3 + - node.labels.myapp==true //<6> - minio2: //<10> - image: minio/minio:RELEASE.2020-04-10T03-34-42Z - hostname: minio2 //<10> - volumes: - - minio2-data:/export //<11> - ports: - - "9002:9000" //<12> - networks: - - minio_distributed //<5> - deploy: - restart_policy: - delay: 10s - max_attempts: 10 - window: 60s - placement: - constraints: - - node.labels.minio2==true //<13> - command: server http://minio{1...4}/export - secrets: - - secret_key - - access_key - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - - minio3: - image: minio/minio:RELEASE.2020-04-10T03-34-42Z - hostname: minio3 - volumes: - - minio3-data:/export - ports: - - "9003:9000" - networks: - - minio_distributed //<5> - deploy: - restart_policy: - delay: 10s - max_attempts: 10 - window: 60s - placement: - constraints: - - node.labels.minio3==true - command: server http://minio{1...4}/export - secrets: - - secret_key - - access_key - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - - minio4: - image: minio/minio:RELEASE.2020-04-10T03-34-42Z - hostname: minio4 - volumes: - - minio4-data:/export - ports: - - "9004:9000" - networks: - - minio_distributed //<5> - deploy: - restart_policy: - delay: 10s - max_attempts: 10 - window: 60s - placement: - constraints: - - node.labels.minio4==true - command: server http://minio{1...4}/export - secrets: - - secret_key - - access_key - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - - web: + mybrowser: image: nginx:1.17.9-alpine deploy: mode: replicated @@ -126,48 +37,31 @@ services: placement: max_replicas_per_node: 1 constraints: - - node.labels.group==minio //<14> + - node.labels.group==myapp //<14> ports: - "8080:80" - "9443:443" volumes: //<15> - - /PATH_to_FILE/minio.conf:/etc/nginx/conf.d/default.conf //<16> - - /PATH_to_FILE/public.crt:/etc/nginx/public.crt //<17> - - /PATH_to_FILE/private.key:/etc/nginx/private.key //<17> + - /PATH_to_FILE/my.conf:/DIR_in_container/my.conf //<16> + #- /PATH_to_FILE/public.crt:/etc/nginx/public.crt //<17> + #- /PATH_to_FILE/private.key:/etc/nginx/private.key //<17> networks: - - minio_distributed //<5> - - -volumes: - minio1-data: - - minio2-data: - - minio3-data: - - minio4-data: + - myapp //<5> networks: - minio_distributed: //<5> + myapp: //<5> driver: overlay -secrets: - secret_key: - external: true - access_key: - external: true ---- <1> Service name <2> Image name -<3> Volume to Use +<3> Volume (bind) to Use <4> Expose port <5> Network to Use <6> Node Placement <7> Start server -<8> insert secrets -<9> health check command <10> *NEW* Service name <11> *NEW* Volume <12> *NEW* Port