mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-04 02:46:23 +00:00
listmonk ready for production
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
POSTGRES_USER=listmonk
|
||||||
|
POSTGRES_PASSWORD=securepassword
|
||||||
|
POSTGRES_DB=listmonk
|
||||||
|
SECRET_KEY=your_super_secret_key
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
[app]
|
||||||
|
# Interface and port where the app will run its webserver. The default value
|
||||||
|
# of localhost will only listen to connections from the current machine. To
|
||||||
|
# listen on all interfaces use '0.0.0.0'. To listen on the default web address
|
||||||
|
# port, use port 80 (this will require running with elevated permissions).
|
||||||
|
address = "0.0.0.0:9000"
|
||||||
|
|
||||||
|
# Database.
|
||||||
|
[db]
|
||||||
|
host = "listmonk-db"
|
||||||
|
port = 5432
|
||||||
|
user = "listmonk"
|
||||||
|
password = "securepassword"
|
||||||
|
|
||||||
|
# Ensure that this database has been created in Postgres.
|
||||||
|
database = "listmonk"
|
||||||
|
|
||||||
|
ssl_mode = "disable"
|
||||||
|
max_open = 25
|
||||||
|
max_idle = 25
|
||||||
|
max_lifetime = "300s"
|
||||||
|
|
||||||
|
# Optional space separated Postgres DSN params. eg: "application_name=listmonk gssencmode=disable"
|
||||||
|
params = ""
|
||||||
+47
-71
@@ -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:
|
services:
|
||||||
db:
|
listmonk-db:
|
||||||
<<: *db-defaults
|
image: postgres:13-alpine
|
||||||
container_name: listmonk_db
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- listmonk
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER:-listmonk}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-securepassword}
|
||||||
|
- POSTGRES_DB=${POSTGRES_DB:-listmonk}
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- listmonk-data:/var/lib/postgresql/data
|
||||||
source: listmonk-data
|
healthcheck:
|
||||||
target: /var/lib/postgresql/data
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 6
|
||||||
|
|
||||||
app:
|
listmonk-init:
|
||||||
<<: *app-defaults
|
image: listmonk/listmonk:latest
|
||||||
container_name: listmonk_app
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
listmonk-db:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- listmonk
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.toml:/listmonk/config.toml
|
- ./config/config.toml:/listmonk/config.toml
|
||||||
|
command: [ "sh", "-c", "yes | ./listmonk --install --config /listmonk/config.toml" ]
|
||||||
|
|
||||||
demo-db:
|
listmonk:
|
||||||
container_name: listmonk_demo_db
|
image: listmonk/listmonk:latest
|
||||||
<<: *db-defaults
|
restart: unless-stopped
|
||||||
|
|
||||||
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:
|
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:
|
networks:
|
||||||
listmonk:
|
listmonk:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
listmonk-data:
|
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
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
POSTGRES_USER=listmonk
|
||||||
|
POSTGRES_PASSWORD=securepassword
|
||||||
|
POSTGRES_DB=listmonk
|
||||||
|
SECRET_KEY=your_super_secret_key
|
||||||
Reference in New Issue
Block a user