-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
106 lines (97 loc) · 3.04 KB
/
docker-compose.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: '3.8'
services:
rustici-engine:
build:
context: ./rustici-engine
dockerfile: Dockerfile
target: main
image: donalmacanri/rustici-engine
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "-w '%{http_code}' -s http://localhost:8080/rustici-engine/api/v2/ping | grep 401"]
interval: 10s
timeout: 5s
retries: 3
environment:
- DATABASE_URL=postgres://rusticiengine:super-secret-password@postgres:5432/rusticiengine
- API_BASIC_ACCOUNTS=apiUser:apiPassword
- API_TOKEN_SECRET=23f9j30efjw9fj049jr3409gj3490gh
- FILE_PATH_TO_UPLOADED_ZIP=/tmp
- FILE_PATH_TO_CONTENT_ROOT=/usr/local/tomcat/webapps/rustici-engine/courses
- WEB_PATH_TO_CONTENT_ROOT=/rustici-engine/courses
# volumes:
# # this volume exists only so that uploaded courses persist between reloads;
# # in a production-ready configuration, course content should be delivered
# # by a dedicated CDN, or web server
# - webapps_root:/usr/local/tomcat/webapps/
profiles:
- run
depends_on:
postgres:
condition: service_healthy
rustici-installer:
build:
context: ./rustici-engine
dockerfile: Dockerfile
target: installer
image: donalmacanri/rustici-engine:installer
environment:
- DATABASE_URL=postgres://rusticiengine:super-secret-password@postgres:5432/rusticiengine
profiles:
- install
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:12
environment:
- POSTGRES_PASSWORD=super-secret-password
configs:
- source: init_dbs.sql
target: /docker-entrypoint-initdb.d/init_dbs.sql
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rusticiengine -d rusticiengine"]
interval: 5s
timeout: 5s
retries: 5
my-lms:
build:
context: ./my-lms
dockerfile: Dockerfile
image: my-lms
ports:
- "8081:8081"
environment:
- ENGINE_TENANT=default
- ENGINE_BASE_URL=http://rustici-engine:8080/rustici-engine/api/v2
- ENGINE_USERNAME=apiUser
- ENGINE_PASSWORD=apiPassword
- MYLMS_SERVER_URL=http://my-lms:8081
profiles:
- run
depends_on:
rustici-engine:
condition: service_healthy
volumes:
postgres_data:
webapps_root:
configs:
init_dbs.sql:
content: |
DO $$$$
BEGIN
IF NOT EXISTS (
SELECT FROM pg_catalog.pg_roles
WHERE rolname = 'rusticiengine') THEN
CREATE ROLE rusticiengine LOGIN PASSWORD 'super-secret-password';
END IF;
END $$$$;
CREATE DATABASE rusticiengine WITH OWNER = rusticiengine;
\c rusticiengine
GRANT ALL PRIVILEGES ON DATABASE rusticiengine TO rusticiengine;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO rusticiengine;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO rusticiengine;
GRANT ALL PRIVILEGES ON SCHEMA public TO rusticiengine;