Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '2.1'
- services:
- api:
- build:
- context: ./api/
- command: /usr/app/node_modules/.bin/nodemon index.js
- volumes:
- - ./api/:/usr/app
- - /usr/app/node_modules
- depends_on:
- db-migrator:
- condition: service_healthy
- db:
- condition: service_healthy
- environment:
- - DATABASE_URL=postgres://postgres:example@db/
- - DATABASE_SCHEMA=app_development
- - NODE_ENV=development
- - CHOKIDAR_USEPOLLING=true
- labels:
- - "traefik.frontend.rule=Host:api.docker.localhost"
- - "traefik.port=4000"
- client:
- build:
- context: ./client/
- command: npm start
- volumes:
- - ./client/:/usr/app
- - /usr/app/node_modules
- labels:
- - "traefik.frontend.rule=Host:client.docker.localhost"
- - "traefik.port=3000"
- db:
- image: mdillon/postgis:9.6
- restart: always
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U postgres"]
- interval: 10s
- timeout: 5s
- retries: 5
- environment:
- POSTGRES_USERNAME: postgres
- POSTGRES_PASSWORD: example
- volumes:
- - postgres-data:/var/lib/postgresql/data
- expose:
- - 5432
- labels:
- - "traefik.backend=db"
- - "traefik.frontend.rule=Host:db.docker.localhost"
- - "traefik.port=5432"
- db-migrator:
- image: boxfuse/flyway
- command: -url=jdbc:postgresql://db:5432/ -user=postgres -password=example migrate
- healthcheck:
- test: ["CMD-SHELL", "ls"]
- interval: 10s
- timeout: 5s
- retries: 5
- volumes:
- - ./api/migrations:/flyway/sql
- depends_on:
- - db
- reverse-proxy:
- image: traefik
- command: --api --docker # Enables the web UI and tells Træfik to listen to docker
- ports:
- - "80:80"
- - "8080:8080" # The Web UI (enabled by --api)
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- volumes:
- postgres-data:
Add Comment
Please, Sign In to add comment