docker-compose.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # NOTE: This docker-compose.yml is meant to be just an example guideline
  2. # on how you can achieve the same. It is not intented to run out of the box
  3. # and you must edit the below configurations to suit your needs.
  4. version: "3.7"
  5. x-app-defaults: &app-defaults
  6. restart: unless-stopped
  7. image: listmonk/listmonk:latest
  8. ports:
  9. - "9000:9000"
  10. networks:
  11. - listmonk
  12. x-db-defaults: &db-defaults
  13. image: postgres:11
  14. ports:
  15. - "9432:5432"
  16. networks:
  17. - listmonk
  18. environment:
  19. - POSTGRES_PASSWORD=listmonk
  20. - POSTGRES_USER=listmonk
  21. - POSTGRES_DB=listmonk
  22. restart: unless-stopped
  23. healthcheck:
  24. test: ["CMD-SHELL", "pg_isready -U listmonk"]
  25. interval: 10s
  26. timeout: 5s
  27. retries: 6
  28. services:
  29. db:
  30. <<: *db-defaults
  31. container_name: listmonk_db
  32. volumes:
  33. - type: volume
  34. source: listmonk-data
  35. target: /var/lib/postgresql/data
  36. app:
  37. <<: *app-defaults
  38. container_name: listmonk_app
  39. depends_on:
  40. - db
  41. volumes:
  42. - ./config.toml:/listmonk/config.toml
  43. demo-db:
  44. container_name: listmonk_demo_db
  45. <<: *db-defaults
  46. demo-app:
  47. <<: *app-defaults
  48. container_name: listmonk_demo_app
  49. command: [sh, -c, "yes | ./listmonk --install --config config-demo.toml && ./listmonk --config config-demo.toml"]
  50. depends_on:
  51. - demo-db
  52. networks:
  53. listmonk:
  54. volumes:
  55. listmonk-data: