docker-compose.images.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # for running in docker compose with prebuilt images
  2. # version is now using "compose spec"
  3. # v2 and v3 are now combined!
  4. # docker-compose v1.27+ required
  5. services:
  6. vote:
  7. image: dockersamples/examplevotingapp_vote
  8. depends_on:
  9. redis:
  10. condition: service_healthy
  11. ports:
  12. - "5000:80"
  13. networks:
  14. - front-tier
  15. - back-tier
  16. result:
  17. image: dockersamples/examplevotingapp_result
  18. depends_on:
  19. db:
  20. condition: service_healthy
  21. ports:
  22. - "5001:80"
  23. networks:
  24. - front-tier
  25. - back-tier
  26. worker:
  27. image: dockersamples/examplevotingapp_worker
  28. depends_on:
  29. redis:
  30. condition: service_healthy
  31. db:
  32. condition: service_healthy
  33. networks:
  34. - back-tier
  35. redis:
  36. image: redis:alpine
  37. volumes:
  38. - "./healthchecks:/healthchecks"
  39. healthcheck:
  40. test: /healthchecks/redis.sh
  41. interval: "5s"
  42. ports: ["6379"]
  43. networks:
  44. - back-tier
  45. db:
  46. image: postgres:15-alpine
  47. environment:
  48. POSTGRES_USER: "postgres"
  49. POSTGRES_PASSWORD: "postgres"
  50. volumes:
  51. - "db-data:/var/lib/postgresql/data"
  52. - "./healthchecks:/healthchecks"
  53. healthcheck:
  54. test: /healthchecks/postgres.sh
  55. interval: "5s"
  56. networks:
  57. - back-tier
  58. volumes:
  59. db-data:
  60. networks:
  61. front-tier:
  62. back-tier: