Skip to content

Instantly share code, notes, and snippets.

@jose4125
Created February 27, 2020 02:33
Show Gist options
  • Select an option

  • Save jose4125/d3eab39c765ce133f19a2dadf9e9eba3 to your computer and use it in GitHub Desktop.

Select an option

Save jose4125/d3eab39c765ce133f19a2dadf9e9eba3 to your computer and use it in GitHub Desktop.
version: "2.4"
services:
proxy:
image: traefik:1.7-alpine
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:80
commands:
- --docker
- --docker.domain=traefik
- --docker.network=proxy
- --docker.watch
- --api
- --defaultentrypoints=http,https
labels:
- traefik.port=8080
- traefik.frontend.rule=Host:traefik.localhost
networks:
- backend
- frontend
redis:
image: redis:alpine
networks:
- frontend
healthcheck:
test: ["CMD", "redis-cli","ping"]
db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_HOST_AUTH_METHOD=true
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
vote:
image: bretfisher/examplevotingapp_vote
ports: 5000:80
networks:
- frontend
depends_on:
redis:
condition: service_healthy
labels:
- traefik.port=80
- traefik.frontend.rule=Host:vote.localhost
result:
build:
context: result
commands: nodemon --inspect=0.0.0.0:9229 server.js
environment:
- NODE_ENV=development
ports:
- 5001:80
- 9229:9229
volumes:
- ./result:/app
networks:
- backend
depends_on:
db:
condition: service_healthy
labels:
- traefik.port=80
- traefik.frontend.rule=Host:result.localhost
worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
frontend:
backend:
volumes:
db-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment