From 59280da20b5ab6509bafb87793cc0077d60d9c27 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 7 Apr 2023 15:57:20 +0200 Subject: [PATCH] docs(examples): update examples to docker compose v2 Reference: https://docs.docker.com/compose/ Related: https://github.com/socketio/socket.io/discussions/4669 --- examples/cluster-haproxy/docker-compose.yml | 94 ++++++++-------- .../cluster-haproxy/{haproxy => }/haproxy.cfg | 0 examples/cluster-haproxy/haproxy/Dockerfile | 2 - examples/cluster-httpd/docker-compose.yml | 94 ++++++++-------- examples/cluster-httpd/{httpd => }/httpd.conf | 0 examples/cluster-httpd/httpd/Dockerfile | 2 - examples/cluster-httpd/server/Dockerfile | 2 +- examples/cluster-nginx/docker-compose.yml | 104 +++++++++--------- 8 files changed, 149 insertions(+), 149 deletions(-) rename examples/cluster-haproxy/{haproxy => }/haproxy.cfg (100%) delete mode 100644 examples/cluster-haproxy/haproxy/Dockerfile rename examples/cluster-httpd/{httpd => }/httpd.conf (100%) delete mode 100644 examples/cluster-httpd/httpd/Dockerfile diff --git a/examples/cluster-haproxy/docker-compose.yml b/examples/cluster-haproxy/docker-compose.yml index fe5aa4f96b..5a23d496b1 100644 --- a/examples/cluster-haproxy/docker-compose.yml +++ b/examples/cluster-haproxy/docker-compose.yml @@ -1,51 +1,53 @@ +services: + haproxy: + image: haproxy:1.7-alpine + volumes: + - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro + links: + - server-john + - server-paul + - server-george + - server-ringo + ports: + - "3000:80" -haproxy: - build: ./haproxy - links: - - server-john - - server-paul - - server-george - - server-ringo - ports: - - "3000:80" + server-john: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=John -server-john: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=John + server-paul: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Paul -server-paul: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Paul + server-george: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=George -server-george: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=George + server-ringo: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Ringo -server-ringo: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Ringo - -redis: - image: redis:alpine - expose: - - "6379" + redis: + image: redis:alpine + expose: + - "6379" diff --git a/examples/cluster-haproxy/haproxy/haproxy.cfg b/examples/cluster-haproxy/haproxy.cfg similarity index 100% rename from examples/cluster-haproxy/haproxy/haproxy.cfg rename to examples/cluster-haproxy/haproxy.cfg diff --git a/examples/cluster-haproxy/haproxy/Dockerfile b/examples/cluster-haproxy/haproxy/Dockerfile deleted file mode 100644 index 3758e18d24..0000000000 --- a/examples/cluster-haproxy/haproxy/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM haproxy:1.7-alpine -COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg diff --git a/examples/cluster-httpd/docker-compose.yml b/examples/cluster-httpd/docker-compose.yml index ad6e6f004a..232281ffa2 100644 --- a/examples/cluster-httpd/docker-compose.yml +++ b/examples/cluster-httpd/docker-compose.yml @@ -1,51 +1,53 @@ +services: + httpd: + image: httpd:2.4-alpine + volumes: + - ./httpd.conf:/usr/local/apache2/conf/httpd.conf:ro + links: + - server-john + - server-paul + - server-george + - server-ringo + ports: + - "3000:80" -httpd: - build: ./httpd - links: - - server-john - - server-paul - - server-george - - server-ringo - ports: - - "3000:80" + server-john: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=John -server-john: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=John + server-paul: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Paul -server-paul: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Paul + server-george: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=George -server-george: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=George + server-ringo: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Ringo -server-ringo: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Ringo - -redis: - image: redis:alpine - expose: - - "6379" + redis: + image: redis:6 + expose: + - "6379" diff --git a/examples/cluster-httpd/httpd/httpd.conf b/examples/cluster-httpd/httpd.conf similarity index 100% rename from examples/cluster-httpd/httpd/httpd.conf rename to examples/cluster-httpd/httpd.conf diff --git a/examples/cluster-httpd/httpd/Dockerfile b/examples/cluster-httpd/httpd/Dockerfile deleted file mode 100644 index 10fef8f3e2..0000000000 --- a/examples/cluster-httpd/httpd/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM httpd:2.4-alpine -COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf diff --git a/examples/cluster-httpd/server/Dockerfile b/examples/cluster-httpd/server/Dockerfile index ca39caa521..caccfba307 100644 --- a/examples/cluster-httpd/server/Dockerfile +++ b/examples/cluster-httpd/server/Dockerfile @@ -1,4 +1,4 @@ -FROM mhart/alpine-node:6 +FROM node:14-alpine # Create app directory RUN mkdir -p /usr/src/app diff --git a/examples/cluster-nginx/docker-compose.yml b/examples/cluster-nginx/docker-compose.yml index e44ca60bad..810c3b6892 100644 --- a/examples/cluster-nginx/docker-compose.yml +++ b/examples/cluster-nginx/docker-compose.yml @@ -1,58 +1,58 @@ +services: + nginx: + image: nginx:alpine + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + links: + - server-john + - server-paul + - server-george + - server-ringo + ports: + - "3000:80" -nginx: - image: nginx:alpine - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - links: - - server-john - - server-paul - - server-george - - server-ringo - ports: - - "3000:80" + server-john: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=John -server-john: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=John + server-paul: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Paul -server-paul: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Paul + server-george: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=George -server-george: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=George + server-ringo: + build: ./server + links: + - redis + expose: + - "3000" + environment: + - NAME=Ringo -server-ringo: - build: ./server - links: - - redis - expose: - - "3000" - environment: - - NAME=Ringo + client: + build: ./client + links: + - nginx -client: - build: ./client - links: - - nginx - -redis: - image: redis:alpine - expose: - - "6379" + redis: + image: redis:6 + expose: + - "6379"