Skip to content

Commit 91c7553

Browse files
committed
Listmonk service
1 parent 5fa22ca commit 91c7553

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.docker/listmonk/config.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[app]
2+
address = "0.0.0.0:9000"
3+
admin_username = "admin"
4+
admin_password = "admin"
5+
6+
[db]
7+
host = "postgres"
8+
port = 5432
9+
user = "postgres"
10+
password = "postgres"
11+
database = "listmonk"
12+
ssl_mode = "disable"
13+
max_open = 25
14+
max_idle = 25
15+
max_lifetime = "300s"
16+
17+
[smtp]
18+
enabled = true
19+
host = "mailer"
20+
port = 1025
21+
auth_protocol = "none"
22+
tls_type = "none"
23+
max_conns = 10
24+
idle_timeout = "15s"
25+
wait_timeout = "5s"
26+
max_msg_retries = 2

.docker/listmonk/entrypoint.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "Waiting for PostgreSQL..."
5+
while ! nc -z postgres 5432; do
6+
sleep 1
7+
done
8+
echo "PostgreSQL is ready"
9+
10+
echo "Creating database if not exists..."
11+
PGPASSWORD=postgres psql -h postgres -U postgres -tc \
12+
"SELECT 1 FROM pg_database WHERE datname = 'listmonk'" | grep -q 1 || \
13+
PGPASSWORD=postgres psql -h postgres -U postgres -c "CREATE DATABASE listmonk"
14+
15+
echo "Running listmonk install (idempotent)..."
16+
./listmonk --install --yes
17+
18+
echo "Starting listmonk..."
19+
exec ./listmonk

compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,18 @@ services:
116116
SKIP_DATABASE_MIGRATIONS: "true"
117117
MERCURE_PUBLISHER_JWT_KEY: "dummy-local-secret"
118118
MERCURE_SUBSCRIBER_JWT_KEY: "dummy-local-secret"
119+
120+
listmonk:
121+
image: listmonk/listmonk:latest
122+
restart: unless-stopped
123+
ports:
124+
- "9000:9000"
125+
environment:
126+
- TZ=Europe/Prague
127+
volumes:
128+
- ./.docker/listmonk/config.toml:/listmonk/config.toml
129+
- ./.docker/listmonk/entrypoint.sh:/listmonk/entrypoint.sh
130+
entrypoint: ["/bin/sh", "/listmonk/entrypoint.sh"]
131+
depends_on:
132+
- postgres
133+
- mailer

0 commit comments

Comments
 (0)