Skip to content

Commit b62fb7b

Browse files
committed
Problem: Docker Compose file not included
Solution: Create a standard Docker Compose file. No image for now since builds haven't been created yet. Add an override file example. Add instructions on how to use these, replacing the previous instructions in the README.
1 parent 81f60af commit b62fb7b

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.DS_Store
2+
docker-compose.override.yml

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,15 @@ services:
3434
```docker-compose-watcher.dir``` specifies the path to the directory where this docker-compose.yml lives. If the file is not named docker-compose.yml, you can instead use the label ```docker-compose-watcher.file``` to specify the correct path and file name. This is necessary because it's not possible to find the docker-compose.yml from a running container.
3535

3636
### 2. Run Compose Updater
37-
Run Docker Compose Watcher using compose:
37+
Copy `docker-compose.override.example.yml` to `docker-compose.override.yml`, and
38+
uncomment the volumes you require inside, depending if you are running Mac,
39+
Linux, or Windows.
3840

39-
```yaml
40-
version: '3'
41-
services:
42-
watcher:
43-
image: virtualzone/compose-updater
44-
restart: always
45-
volumes:
46-
- "/var/run/docker.sock:/var/run/docker.sock:ro"
47-
- "/home/docker:/home/docker:ro"
48-
environment:
49-
INTERVAL: 60
50-
```
41+
Then, run Compose Updater:
5142

52-
It's important to mount ```/var/run/docker.sock``` and the directory your compose files reside in (```/home/docker``` in the example above). Please note that in the home directory bind mount (e.g. ```/home/docker:/home/docker:ro```), **both sides must match**. Please see the [Relative Paths](#relative-paths) section for more information.
43+
```shell
44+
docker compose up -d --build
45+
```
5346

5447
If the registry you're pulling from require authentification, you could mount `~/.docker/config.json` from the host inside the `watcher` service.
5548
Assuming your host user is called `ubuntu`, adding this line to the `volumes` declaration of the `watcher` service should work :
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
watcher:
3+
volumes:
4+
5+
# Mac users, uncomment this and edit your system username on both sides. For
6+
# safety, the mount is read-only.
7+
# - "/Users/MyNameHere:/Users/MyNameHere:ro"
8+
9+
# Linux users, uncomment this and edit your system username on both sides.
10+
# For safety, the mount is read-only.
11+
# - "/home/MyNameHere:/home/MyNameHere:ro"
12+
13+
# Windows users, uncomment this and edit your system username on both sides.
14+
# For safety, the mount is read-only.
15+
# - "/mnt/c/Users/MyNameHere:/mnt/c/Users/MyNameHere:ro"
16+
17+
# Uncomment this if you require the healthcheck endpoint to be exposed
18+
# to localhost. Please do not expose it on any networks!
19+
# ports:
20+
# - localhost:8080:8080

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
watcher:
3+
build: .
4+
restart: unless-stopped
5+
volumes:
6+
- "/var/run/docker.sock:/var/run/docker.sock:ro"
7+
environment:
8+
INTERVAL: 60
9+
healthcheck:
10+
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080"]
11+
interval: 5s
12+
timeout: 1s
13+
retries: 3

0 commit comments

Comments
 (0)