-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
62 lines (58 loc) · 1.88 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
62 lines (58 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
x-db-defaults: &db-defaults
LISTMONK_db__host: listmonk_test_db
LISTMONK_db__port: "5432"
LISTMONK_db__user: listmonk
LISTMONK_db__password: listmonk
LISTMONK_db__database: listmonk
LISTMONK_db__ssl_mode: disable
LISTMONK_db__max_open: "25"
LISTMONK_db__max_idle: "25"
LISTMONK_db__max_lifetime: "300s"
x-app-defaults: &app-defaults
LISTMONK_app__address: "0.0.0.0:9000"
LISTMONK_ADMIN_USER: admin
LISTMONK_ADMIN_PASSWORD: adminpass
services:
listmonk_test_app:
container_name: listmonk_php_sdk_test
image: listmonk/listmonk:latest
ports:
- "9005:9000"
environment:
<<: [*db-defaults, *app-defaults]
depends_on:
listmonk_test_db:
condition: service_healthy
command:
- sh
- -c
- |
apk add --no-cache postgresql-client
./listmonk --install --idempotent --yes
PGPASSWORD=listmonk psql -h listmonk_test_db -U listmonk -d listmonk -c "INSERT INTO users (username, password_login, password, email, name, type, user_role_id, status, created_at, updated_at) VALUES ('api', false, 'testtoken123', 'api@test.local', 'API User', 'api', 1, 'enabled', NOW(), NOW()) ON CONFLICT (username) DO NOTHING;"
./listmonk
networks:
- listmonk_test
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "--header", "Authorization: token api:testtoken123", "http://localhost:9000/api/health"]
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
listmonk_test_db:
container_name: listmonk_php_sdk_test_db
image: postgres:17-alpine
environment:
POSTGRES_USER: listmonk
POSTGRES_PASSWORD: listmonk
POSTGRES_DB: listmonk
healthcheck:
test: ["CMD-SHELL", "pg_isready -U listmonk"]
interval: 5s
timeout: 5s
retries: 10
networks:
- listmonk_test
networks:
listmonk_test:
name: listmonk_php_sdk_test_network