From d81ca160e93093cd00a81973ee3a565a28139816 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 21 Jun 2024 15:26:49 +0800 Subject: [PATCH] build: add Docker Compose setup with demo and watchtower services - Add `docker-compose.yaml` with services `demo01`, `demo02`, and `watchtower` - Configure `demo01` to use the latest image and map port `8082` to `8000` - Configure `demo02` to use image version `1` and map port `8083` to `8000` - Add `watchtower` service with volume mappings for Docker configuration and socket - Set `watchtower` command to run with interval `5` and cleanup option Signed-off-by: Bo-Yi Wu --- homework04/docker-compose.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 homework04/docker-compose.yaml diff --git a/homework04/docker-compose.yaml b/homework04/docker-compose.yaml new file mode 100644 index 0000000..be03c13 --- /dev/null +++ b/homework04/docker-compose.yaml @@ -0,0 +1,20 @@ +services: + demo01: + image: ghcr.io/go-training/cicd-workshop-highercloud:latest + ports: + - "8082:8000" + restart: always + + demo02: + image: ghcr.io/go-training/cicd-workshop-highercloud:1 + ports: + - "8083:8000" + restart: always + + watchtower: + image: containrrr/watchtower + restart: always + volumes: + - $HOME/.docker/config.json:/config.json + - /var/run/docker.sock:/var/run/docker.sock + command: --interval 5 --cleanup