-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
127 lines (118 loc) · 3.32 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
version: "3.7"
services:
certbot:
container_name: certbot
image: certbot/certbot:latest
depends_on:
- gateway
command: >-
certonly --reinstall --webroot --webroot-path=/var/www/certbot
--email ${EMAIL} --agree-tos --no-eff-email
-d ${DOMAIN}
volumes:
- ./gateway/etc/letsencrypt:/etc/letsencrypt
- ./certbot/data:/var/www/certbot
restarter:
image: docker:cli
volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
command: ["/bin/sh", "-c", "while true; do sleep 86400; docker restart certbot; done"]
restart: unless-stopped
gateway:
image: sgs/gateway:${TAG:-v1.0.0}
build:
context: ./gateway/
restart: "unless-stopped"
container_name: sgs-gateway
environment:
- DOMAIN
depends_on:
- frontend
- backend
ports:
- "80:80"
- "443:443"
volumes:
- ./gateway/templates:/etc/nginx/templates:ro
- ./gateway/etc/letsencrypt:/etc/letsencrypt:ro
outcomes:
image: sgs/outcomes:${TAG:-v1.0.0}
restart: "unless-stopped"
container_name: sgs-outcomes
depends_on:
- backend
- proxy
ports:
- "3000:80"
proxy:
image: sgs/proxy:${TAG:-v1.0.0}
restart: "unless-stopped"
container_name: sgs-proxy
ports:
- "5000:5000"
env_file:
- .env
frontend:
image: sgs/frontend:${TAG:-v1.0.0}
build:
context: ./frontend/
restart: "unless-stopped"
container_name: sgs-frontend
environment:
SPA_PATH: /openmrs/spa
API_URL: /openmrs
SPA_CONFIG_URLS: /openmrs/spa/sgs_config.json
SPA_DEFAULT_LOCALE:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
timeout: 5s
depends_on:
- backend
volumes:
- ./frontend/sgs_config.json:/usr/share/nginx/html/sgs_config.json
backend:
image: sgs/backend:${TAG:-v1.0.0}
build:
context: .
restart: "unless-stopped"
container_name: sgs-backend
depends_on:
- db
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
timeout: 5s
volumes:
- openmrs_data:/openmrs/data
- ./distro/configuration/:/openmrs/distribution/openmrs_config
env_file:
- .env
# MariaDB
db:
image: mariadb:10.8.2
restart: "unless-stopped"
container_name: sgs-mariadb
command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci"
healthcheck:
test: "mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
volumes:
- db_data:/var/lib/mysql
- ./db:/docker-entrypoint-initdb.d:ro
volumes:
openmrs_data: ~
db_data: ~
certs: