Guest User

Untitled

a guest
Aug 4th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. version: '2.1'
  2.  
  3. services:
  4. api:
  5. build:
  6. context: ./api/
  7. command: /usr/app/node_modules/.bin/nodemon index.js
  8. volumes:
  9. - ./api/:/usr/app
  10. - /usr/app/node_modules
  11. depends_on:
  12. db-migrator:
  13. condition: service_healthy
  14. db:
  15. condition: service_healthy
  16. environment:
  17. - DATABASE_URL=postgres://postgres:example@db/
  18. - DATABASE_SCHEMA=app_development
  19. - NODE_ENV=development
  20. - CHOKIDAR_USEPOLLING=true
  21. labels:
  22. - "traefik.frontend.rule=Host:api.docker.localhost"
  23. - "traefik.port=4000"
  24. client:
  25. build:
  26. context: ./client/
  27. command: npm start
  28. volumes:
  29. - ./client/:/usr/app
  30. - /usr/app/node_modules
  31. labels:
  32. - "traefik.frontend.rule=Host:client.docker.localhost"
  33. - "traefik.port=3000"
  34. db:
  35. image: mdillon/postgis:9.6
  36. restart: always
  37. healthcheck:
  38. test: ["CMD-SHELL", "pg_isready -U postgres"]
  39. interval: 10s
  40. timeout: 5s
  41. retries: 5
  42. environment:
  43. POSTGRES_USERNAME: postgres
  44. POSTGRES_PASSWORD: example
  45. volumes:
  46. - postgres-data:/var/lib/postgresql/data
  47. expose:
  48. - 5432
  49. labels:
  50. - "traefik.backend=db"
  51. - "traefik.frontend.rule=Host:db.docker.localhost"
  52. - "traefik.port=5432"
  53. db-migrator:
  54. image: boxfuse/flyway
  55. command: -url=jdbc:postgresql://db:5432/ -user=postgres -password=example migrate
  56. healthcheck:
  57. test: ["CMD-SHELL", "ls"]
  58. interval: 10s
  59. timeout: 5s
  60. retries: 5
  61. volumes:
  62. - ./api/migrations:/flyway/sql
  63. depends_on:
  64. - db
  65. reverse-proxy:
  66. image: traefik
  67. command: --api --docker # Enables the web UI and tells Træfik to listen to docker
  68. ports:
  69. - "80:80"
  70. - "8080:8080" # The Web UI (enabled by --api)
  71. volumes:
  72. - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
  73. volumes:
  74. postgres-data:
Add Comment
Please, Sign In to add comment