Skip to content

Commit 188a107

Browse files
committed
Modified project to use Mutagen Compose integration.
This commit modifies the docker-compose.yml file to add support for Mutagen integration. This allows the project to be run on a cloud-based Docker host while still being edited and accessed locally. For more information, please see: - https://mutagen.io - https://mutagen.io/documentation/orchestration/compose Signed-off-by: Jacob Howard <jacob@mutagen.io>
1 parent 3accda9 commit 188a107

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
A simple distributed application running across multiple Docker containers.
44

5+
**NOTE**: This example has been modified to support integration with
6+
[Mutagen](https://mutagen.io), allowing the application to be run on a remote
7+
Docker host while still being edited and accessed locally. For more information,
8+
please see the
9+
[relevant documentation](https://mutagen.io/documentation/orchestration/compose).
10+
511
## Getting started
612

713
Download [Docker Desktop](https://www.docker.com/products/docker-desktop) for Mac or Windows. [Docker Compose](https://docs.docker.com/compose) will be automatically installed. On Linux, make sure you have the latest version of [Compose](https://docs.docker.com/compose/install/).

docker-compose.yml

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ services:
1010
depends_on:
1111
redis:
1212
condition: service_healthy
13-
healthcheck:
13+
healthcheck:
1414
test: ["CMD", "curl", "-f", "http://localhost"]
1515
interval: 15s
1616
timeout: 5s
1717
retries: 3
1818
start_period: 10s
1919
volumes:
20-
- ./vote:/app
21-
ports:
22-
- "5000:80"
20+
- vote-code:/app
2321
networks:
2422
- front-tier
2523
- back-tier
@@ -30,12 +28,9 @@ services:
3028
entrypoint: nodemon server.js
3129
depends_on:
3230
db:
33-
condition: service_healthy
31+
condition: service_healthy
3432
volumes:
35-
- ./result:/app
36-
ports:
37-
- "5001:80"
38-
- "5858:5858"
33+
- result-code:/app
3934
networks:
4035
- front-tier
4136
- back-tier
@@ -45,16 +40,16 @@ services:
4540
context: ./worker
4641
depends_on:
4742
redis:
48-
condition: service_healthy
43+
condition: service_healthy
4944
db:
50-
condition: service_healthy
45+
condition: service_healthy
5146
networks:
5247
- back-tier
5348

5449
redis:
5550
image: redis:alpine
5651
volumes:
57-
- "./healthchecks:/healthchecks"
52+
- "healthchecks:/healthchecks"
5853
healthcheck:
5954
test: /healthchecks/redis.sh
6055
interval: "5s"
@@ -68,7 +63,7 @@ services:
6863
POSTGRES_PASSWORD: "postgres"
6964
volumes:
7065
- "db-data:/var/lib/postgresql/data"
71-
- "./healthchecks:/healthchecks"
66+
- "healthchecks:/healthchecks"
7267
healthcheck:
7368
test: /healthchecks/postgres.sh
7469
interval: "5s"
@@ -83,14 +78,46 @@ services:
8378
profiles: ["seed"]
8479
depends_on:
8580
vote:
86-
condition: service_healthy
81+
condition: service_healthy
8782
networks:
8883
- front-tier
8984
restart: "no"
9085

9186
volumes:
9287
db-data:
88+
healthchecks:
89+
vote-code:
90+
result-code:
9391

9492
networks:
9593
front-tier:
9694
back-tier:
95+
96+
x-mutagen:
97+
sync:
98+
defaults:
99+
ignore:
100+
vcs: true
101+
healthchecks:
102+
alpha: "./healthchecks"
103+
beta: "volume://healthchecks"
104+
mode: "one-way-safe"
105+
vote:
106+
alpha: "./vote"
107+
beta: "volume://vote-code"
108+
mode: "one-way-safe"
109+
result:
110+
alpha: "./result"
111+
beta: "volume://result-code"
112+
mode: "one-way-safe"
113+
configurationBeta:
114+
permissions:
115+
defaultOwner: "id:1000"
116+
defaultGroup: "id:1000"
117+
forward:
118+
vote:
119+
source: "tcp::5000"
120+
destination: "network://front-tier:tcp:vote:80"
121+
result:
122+
source: "tcp::5001"
123+
destination: "network://front-tier:tcp:result:80"

0 commit comments

Comments
 (0)