Skip to content
Permalink
Browse files
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>
  • Loading branch information
xenoscopic committed Nov 9, 2021
1 parent 5edf3f7 commit b7bde6058a71c5b3f167fb1d7dee08b08a7ef758
Showing 2 changed files with 46 additions and 13 deletions.
@@ -3,6 +3,12 @@ Example Voting App

A simple distributed application running across multiple Docker containers.

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

Getting started
---------------

@@ -9,11 +9,9 @@ services:
command: python app.py
depends_on:
redis:
condition: service_healthy
condition: service_healthy
volumes:
- ./vote:/app
ports:
- "5000:80"
- vote-code:/app
networks:
- front-tier
- back-tier
@@ -24,12 +22,9 @@ services:
command: nodemon server.js
depends_on:
db:
condition: service_healthy
condition: service_healthy
volumes:
- ./result:/app
ports:
- "5001:80"
- "5858:5858"
- result-code:/app
networks:
- front-tier
- back-tier
@@ -39,16 +34,16 @@ services:
context: ./worker
depends_on:
redis:
condition: service_healthy
condition: service_healthy
db:
condition: service_healthy
condition: service_healthy
networks:
- back-tier

redis:
image: redis:5.0-alpine3.10
volumes:
- "./healthchecks:/healthchecks"
- "healthchecks:/healthchecks"
healthcheck:
test: /healthchecks/redis.sh
interval: "5s"
@@ -63,7 +58,7 @@ services:
POSTGRES_PASSWORD: "postgres"
volumes:
- "db-data:/var/lib/postgresql/data"
- "./healthchecks:/healthchecks"
- "healthchecks:/healthchecks"
healthcheck:
test: /healthchecks/postgres.sh
interval: "5s"
@@ -72,7 +67,39 @@ services:

volumes:
db-data:
healthchecks:
vote-code:
result-code:

networks:
front-tier:
back-tier:

x-mutagen:
sync:
defaults:
ignore:
vcs: true
healthchecks:
alpha: "./healthchecks"
beta: "volume://healthchecks"
mode: "one-way-safe"
vote:
alpha: "./vote"
beta: "volume://vote-code"
mode: "one-way-safe"
result:
alpha: "./result"
beta: "volume://result-code"
mode: "one-way-safe"
configurationBeta:
permissions:
defaultOwner: "id:1000"
defaultGroup: "id:1000"
forward:
vote:
source: "tcp::5000"
destination: "network://front-tier:tcp:vote:80"
result:
source: "tcp::5001"
destination: "network://front-tier:tcp:result:80"

0 comments on commit b7bde60

Please sign in to comment.