generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
121 lines (116 loc) · 2.81 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
---
version: '3.8'
volumes:
postgres-data:
services:
admin:
container_name: admin
depends_on:
api:
condition: service_healthy
entrypoint:
- sh
- -c
- cd libs && npm ci &&
cd ../admin && npm ci &&
npm run start:admin
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4200/admin"]
interval: 10s
retries: 3
start_period: 60s
timeout: 5s
image: node:18
ports:
- 4200:4200
volumes:
- .:/app:z
working_dir: /app
api:
container_name: api
depends_on:
db:
condition: service_healthy
entrypoint:
- sh
- -c
- cd libs && npm ci &&
cd ../api && npm i &&
npm run start:api
environment:
- DB_HOST=db
- DB_NAME=fom
- DB_PASSWORD=test
- DB_SSL=false
- DB_TESTDATA=true
- DB_TYPE=postgres
- DB_USERNAME=postgres
- SECURITY_ENABLED=false
- BYPASS_CORS=true
- OBJECT_STORAGE_URL=nrs.objectstore.gov.bc.ca
- OBJECT_STORAGE_ACCESS_ID=nr-fom-dev
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3333/api"]
interval: 10s
retries: 3
start_period: 60s
timeout: 5s
image: node:18
ports:
- 3333:3333
links:
- db:database
volumes:
- .:/app:z
working_dir: /app
db:
container_name: db
# Postgis with extensions (postgis_topology, fuzzystrmatch, postgis_tiger_geocoder)
image: postgis/postgis:13-master
# Add pgcrypto extension (sed) if not present (grep), then start normally (entrypoint)
entrypoint:
- sh
- -c
- grep -qxF 'CREATE EXTENSION IF NOT EXISTS pgcrypto'/docker-entrypoint-initdb.d/10_postgis.sh ||
sed -i '/EXISTS postgis_tiger_geocoder;*/a CREATE EXTENSION IF NOT EXISTS pgcrypto;'
/docker-entrypoint-initdb.d/10_postgis.sh &&
/usr/local/bin/docker-entrypoint.sh postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=test
- POSTGRES_DB=fom
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_PORT=5342
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
retries: 3
start_period: 30s
timeout: 5s
volumes:
- postgres-data:/var/lib/postgres/data
ports:
- 5432:5432
public:
container_name: public
depends_on:
api:
condition: service_healthy
entrypoint:
- sh
- -c
- cd libs && npm ci &&
cd ../public && npm ci &&
npm run start:public
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4300/public"]
interval: 10s
retries: 3
start_period: 60s
timeout: 5s
image: node:18
ports:
- 4300:4300
volumes:
- .:/app:z
working_dir: /app