Skip to content

Commit

Permalink
build: add Docker Compose setup with demo and watchtower services
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
appleboy committed Jun 21, 2024
1 parent 29909d4 commit d81ca16
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions homework04/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d81ca16

Please sign in to comment.