docker-compose.images.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. networks:
  43. - back-tier
  44. db:
  45. image: postgres:15-alpine
  46. environment:
  47. POSTGRES_USER: "postgres"
  48. POSTGRES_PASSWORD: "postgres"
  49. volumes:
  50. - "db-data:/var/lib/postgresql/data"
  51. - "./healthchecks:/healthchecks"
  52. healthcheck:
  53. test: /healthchecks/postgres.sh
  54. interval: "5s"
  55. networks:
  56. - back-tier
  57. volumes:
  58. db-data:
  59. networks:
  60. front-tier:
  61. back-tier: