listmonk/docker-compose.yml
Karan Sharma 8d40422e0f feat: Add easy install script
- Add a shell script to orchestrate a production setup with
`docker-compose`. The script fetches config and `docker-compose.yml`
from the `master` branch, generates a secure password, performs DB
migrations and starts the container services.

- Add a health check for Postgres container service in `docker-compose.yml`.

- Add cusotm `container_name` for services inside `docker-compose`.
This is helpful to check the status of containers in the install shell script.
2021-06-15 18:38:45 +05:30

64 lines
1.4 KiB
YAML

# NOTE: This docker-compose.yml is meant to be just an example guideline
# on how you can achieve the same. It is not intented to run out of the box
# and you must edit the below configurations to suit your needs.
version: "3.7"
x-app-defaults: &app-defaults
restart: unless-stopped
image: listmonk/listmonk:latest
ports:
- "9000:9000"
networks:
- listmonk
x-db-defaults: &db-defaults
image: postgres:11
ports:
- "9432:5432"
networks:
- listmonk
environment:
- POSTGRES_PASSWORD=listmonk
- POSTGRES_USER=listmonk
- POSTGRES_DB=listmonk
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U listmonk"]
interval: 10s
timeout: 5s
retries: 6
services:
db:
<<: *db-defaults
container_name: listmonk_db
volumes:
- type: volume
source: listmonk-data
target: /var/lib/postgresql/data
app:
<<: *app-defaults
container_name: listmonk_app
depends_on:
- db
volumes:
- ./config.toml:/listmonk/config.toml
demo-db:
container_name: listmonk_demo_db
<<: *db-defaults
demo-app:
<<: *app-defaults
container_name: listmonk_demo_app
command: [sh, -c, "yes | ./listmonk --install --config config-demo.toml && ./listmonk --config config-demo.toml"]
depends_on:
- demo-db
networks:
listmonk:
volumes:
listmonk-data: