docker-compose.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # version is now using "compose spec"
  2. # v2 and v3 are now combined!
  3. # docker-compose v1.27+ required
  4. services:
  5. vote:
  6. build: ./vote
  7. # use python rather than gunicorn for local dev
  8. command: python app.py
  9. depends_on:
  10. redis:
  11. condition: service_healthy
  12. volumes:
  13. - ./vote:/app
  14. ports:
  15. - "5000:80"
  16. networks:
  17. - front-tier
  18. - back-tier
  19. result:
  20. build: ./result
  21. # use nodemon rather than node for local dev
  22. command: nodemon server.js
  23. depends_on:
  24. db:
  25. condition: service_healthy
  26. volumes:
  27. - ./result:/app
  28. ports:
  29. - "5001:80"
  30. - "5858:5858"
  31. networks:
  32. - front-tier
  33. - back-tier
  34. worker:
  35. build:
  36. context: ./worker
  37. depends_on:
  38. redis:
  39. condition: service_healthy
  40. db:
  41. condition: service_healthy
  42. networks:
  43. - back-tier
  44. redis:
  45. image: redis:5.0-alpine3.10
  46. volumes:
  47. - "./healthchecks:/healthchecks"
  48. healthcheck:
  49. test: /healthchecks/redis.sh
  50. interval: "5s"
  51. ports: ["6379"]
  52. networks:
  53. - back-tier
  54. db:
  55. image: postgres:9.4
  56. environment:
  57. POSTGRES_USER: "postgres"
  58. POSTGRES_PASSWORD: "postgres"
  59. volumes:
  60. - "db-data:/var/lib/postgresql/data"
  61. - "./healthchecks:/healthchecks"
  62. healthcheck:
  63. test: /healthchecks/postgres.sh
  64. interval: "5s"
  65. networks:
  66. - back-tier
  67. volumes:
  68. db-data:
  69. networks:
  70. front-tier:
  71. back-tier: