-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
197 lines (185 loc) · 4.54 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
---
services:
app:
build:
context: ./
dockerfile: ./lauth/Dockerfile
target: development
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
environment:
- BEARER_TOKEN=TG9yZCBvZiB0aGUgUmluZ3MK
- DATABASE_URL=mysql2://lauth:[email protected]:3306/lauth_demo
hostname: app.lauth.local
networks:
default:
aliases: ["app"]
ports:
- "127.0.0.1:2300:2300"
depends_on:
mariadb:
condition: "service_healthy"
healthcheck:
test: [ "CMD", "curl", "--fail", "http://app.lauth.local:2300", "--output", "/dev/null", "--silent" ]
interval: "5s"
timeout: "2s"
retries: 3
volumes:
- ./lauth:/lauth/lauth
proxied-test-app:
image: python:3
hostname: proxied-test-app.lauth.local
networks:
default:
aliases: ["proxied-test-app"]
ports:
- "127.0.0.1:8008:8008"
volumes:
- ./test-site/app:/usr/src/app
working_dir: "/usr/src/app"
command: [ "python", "-u", "./proxied.py" ]
app-dev:
profiles: ["test"]
build:
context: ./
dockerfile: ./lauth/Dockerfile
target: development
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
depends_on:
mariadb:
condition: "service_healthy"
volumes:
- ./lauth:/lauth/lauth
command: ["rspec"]
mariadb:
image: bitnami/mariadb
hostname: db.lauth.local
networks:
default:
aliases: ["db"]
ports:
- "127.0.0.1:3306:3306"
volumes:
- mariadb_data:/bitnami/mariadb
- ./db:/sql
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_DATABASE=lauth
- MARIADB_USER=lauth
- MARIADB_PASSWORD=lauth
- TZ=America/Detroit
healthcheck:
test: ["CMD", "mariadb-admin", "-u", "root", "status"]
interval: "10s"
timeout: "10s"
retries: 3
apache:
build:
context: ./
dockerfile: ./apache/Dockerfile
target: test-server
ports:
- "127.0.0.1:8888:80"
hostname: "www.lauth.local"
networks:
default:
aliases: ["apache"]
healthcheck:
test: ["CMD", "http-check", "http://www.lauth.local"]
interval: "5s"
timeout: "2s"
retries: 3
module:
profiles: [ "dev" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: tests
environment:
- LAUTH_TEST_API_URL=http://mock-api:9000
volumes:
- ./apache/client:/lauth/apache/client
- ./apache/module:/lauth/apache/module
- build_cache:/lauth/apache/build
packages:
profiles: [ "packages" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: packages
restart: "no"
volumes:
- ./apache/packages:/lauth/apache/packages
command: ["sh", "-c", "cp *.deb *.changes /lauth/apache/packages"]
mock-api:
profiles: [ "test", "integration" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: tests
hostname: mock-api.lauth.local
networks:
default:
aliases: ["mock-api"]
ports:
- "127.0.0.1:9000:9000"
healthcheck:
test: [ "CMD", "curl", "--fail", "http://127.0.0.1:9000", "--output", "/dev/null", "--silent" ]
interval: "10s"
timeout: "10s"
retries: 3
command: ["./http-service", "9000"]
client-tests:
profiles: [ "test", "integration" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: client-tests
depends_on:
mock-api:
condition:
"service_healthy"
environment:
- LAUTH_TEST_API_URL=http://mock-api.lauth.local:9000
test:
profiles: ["test"]
build:
context: ./
dockerfile: ./test/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
depends_on:
apache:
condition: "service_healthy"
app:
condition: "service_healthy"
proxied-test-app:
condition: "service_started"
mariadb:
condition: "service_healthy"
volumes:
- ./test:/lauth/test
dbsetup:
profiles: ["setup"]
image: bitnami/mariadb
depends_on:
mariadb:
condition: "service_healthy"
restart: "no"
volumes:
- ./db:/sql
command:
- /bin/bash
- "-c"
- "/sql/setup.sh -u lauth -p lauth -h db.lauth.local -b lauth_development && \
/sql/setup.sh -u lauth -p lauth -h db.lauth.local -b lauth_test && \
/sql/setup.sh -u lauth -p lauth -h db.lauth.local -a -b lauth_demo"
volumes:
mariadb_data:
build_cache:
networks:
default: