listmonk ready for production

This commit is contained in:
2025-02-19 17:09:42 -08:00
parent dbec39fafd
commit 130067d435
4 changed files with 80 additions and 72 deletions
+48 -72
View File
@@ -1,84 +1,60 @@
# NOT TESTED
# 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.
# https://github.com/knadh/listmonk/blob/master/docker-compose.yml
x-app-defaults: &app-defaults
restart: unless-stopped
image: listmonk/listmonk:latest
ports:
- "9000:9000"
networks:
- listmonk
environment:
- TZ=Etc/UTC
x-db-defaults: &db-defaults
image: postgres:13-alpine
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
listmonk-db:
image: postgres:13-alpine
restart: unless-stopped
networks:
- listmonk
environment:
- POSTGRES_USER=${POSTGRES_USER:-listmonk}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-securepassword}
- POSTGRES_DB=${POSTGRES_DB:-listmonk}
volumes:
- type: volume
source: listmonk-data
target: /var/lib/postgresql/data
- listmonk-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
interval: 10s
timeout: 5s
retries: 6
app:
<<: *app-defaults
container_name: listmonk_app
listmonk-init:
image: listmonk/listmonk:latest
depends_on:
- db
listmonk-db:
condition: service_healthy
networks:
- listmonk
volumes:
- ./config.toml:/listmonk/config.toml
- ./config/config.toml:/listmonk/config.toml
command: [ "sh", "-c", "yes | ./listmonk --install --config /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"]
listmonk:
image: listmonk/listmonk:latest
restart: unless-stopped
depends_on:
- demo-db
listmonk-db:
condition: service_healthy
listmonk-init:
condition: service_completed_successfully
ports:
- "9000:9000"
networks:
- listmonk
volumes:
- ./config/config.toml:/listmonk/config.toml
- ./data/listmonk:/app/data
environment:
- SECRET_KEY=${SECRET_KEY}
- DB_PROVIDER=postgres
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${POSTGRES_USER:-listmonk}
- DB_PASSWORD=${POSTGRES_DB:-listmonk}
- DB_NAME=${POSTGRES_DB}
- WEB_SERVER_HOST=0.0.0.0
- WEB_SERVER_PORT=8000
networks:
listmonk:
volumes:
listmonk-data:
version: '3'
services:
listmonk:
image: listmonk/listmonk:latest
container_name: listmonk
restart: always
ports:
- "9000:9000"
volumes:
- ./data/listmonk:/app/data
environment:
- SECRET_KEY=<your_secret_key>
- DB_PROVIDER=sqlite3
- DB_SOURCE=/app/data/listmonk.db
- WEB_SERVER_HOST=localhost
- WEB_SERVER_PORT=9000
listmonk-data: