-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.local.yml
181 lines (177 loc) · 4.75 KB
/
docker-compose.local.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
#
# For Setup Documentation go to https://github.com/bcgov/invasivesbc/wiki/Docker-Setup
#
services:
########################
# Postgis DB
########################
db:
image: postgis/postgis:16-3.5-alpine
container_name: ${PROJECT_NAME}-${TAG}-db
ports:
- ${DB_PORT}:${DB_PORT}
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_DATABASE}
- PORT=${DB_PORT}
- TZ=America/Vancouver
healthcheck:
test: ['CMD-SHELL', 'pg_isready', '-U', '${DB_USER}']
interval: 10s
timeout: 5s
retries: 5
start_period: 60s
networks:
- local-network
volumes:
- postgres:/var/lib/postgresql/data
- ./database/.docker/db/entrypoint:/docker-entrypoint-initdb.d
########################
# Knex Migrator
########################
db_setup:
image: ${PROJECT_NAME}-${TAG}-postgres-setup-img
container_name: ${PROJECT_NAME}-${TAG}-db-setup
build:
context: ./database
dockerfile: ./.docker/db/Dockerfile.setup
environment:
- DB_HOST=${DB_HOST}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_PORT=${DB_PORT}
- DB_DATABASE=${DB_DATABASE}
- ENVIRONMENT=local
- REACT_APP_REAL_NODE_ENV=local
- NODE_ENV=local
- SKIP_POSTGRES9_COMPATIBILITY=true
networks:
- local-network
links:
- db
restart: on-failure
depends_on:
db:
condition: service_healthy
########################
# API
########################
api:
image: ${PROJECT_NAME}-${TAG}-api-img
container_name: ${PROJECT_NAME}-${TAG}-api
build:
context: ./
dockerfile: ./api/.docker/api/Dockerfile
ports:
- ${API_PORT}:${API_PORT}
environment:
API_HOST: ${API_HOST:-localhost}
API_PORT: ${API_PORT:-3002}
DB_HOST: ${DB_HOST}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
DB_PORT: ${DB_PORT:-5432}
DB_DATABASE: ${DB_DATABASE}
APP_CERTIFICATE_URL: ${APP_CERTIFICATE_URL}
APP_CERTIFICATE_URL_TEST: ${APP_CERTIFICATE_URL_TEST}
OBJECT_STORE_URL: ${OBJECT_STORE_URL}
OBJECT_STORE_ACCESS_KEY_ID: ${OBJECT_STORE_ACCESS_KEY_ID}
OBJECT_STORE_SECRET_KEY_ID: ${OBJECT_STORE_SECRET_KEY_ID}
OBJECT_STORE_BUCKET_NAME: ${OBJECT_STORE_BUCKET_NAME}
ENVIRONMENT: local
NODE_ENV: local
networks:
- local-network
links:
- db
depends_on:
db:
condition: service_healthy
develop:
watch:
- action: sync
path: ./api
target: /opt/app-root/api
ignore:
- ./api/node_modules/
- action: rebuild
path: ./sharedapi
target: /opt/app-root/sharedAPI
ignore:
- ./sharedapi/node_modules/
########################
# Frontend
########################
# Build the nginx web-server docker image
frontend:
container_name: invasives-frontend
build:
context: ./
dockerfile: ./app/.docker/Dockerfile
ports:
- 3000:3000
environment:
REACT_APP_API_HOST: ${REACT_APP_API_HOST:-http://${API_HOST:-localhost}:${API_PORT:-3002}}
SSO_CLIENT_ID: ${SSO_CLIENT_ID}
SSO_REALM: standard
SSO_URL: ${SSO_URL:-https://dev.loginproxy.gov.bc.ca/auth/}
REDIRECT_URI: ${REDIRECT_URI:-http://localhost:3000/home/landing}
PUBLIC_MAP_URL: ${PUBLIC_MAP_URL}
IAPP_GEOJSON_URL: ${IAPP_GEOJSON_URL}
SILENT_CHECK_URI: ${SILENT_CHECK_URI}
healthcheck:
test: curl--fail http://localhost:3000 || exit 1
interval: 20s
timeout: 30s
retries: 5
start_period: 30s
develop:
watch:
- action: sync
path: .git
target: /opt/app-root/.git
- action: sync
path: ./app
target: /opt/app-root/app
ignore:
- ./app/node_modules/
- action: rebuild
path: ./sharedapi
target: /opt/app-root/sharedAPI
ignore:
- ./sharedapi/node_modules/
depends_on:
db:
condition: service_healthy
# api:
# condition: service_healthy
networks:
- local-network
########################
# PGAdmin
########################
pgadmin:
container_name: invasives-pgadmin
image: dpage/pgadmin4
ports:
- 5050:80
environment:
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_DEFAULT_EMAIL: [email protected]
networks:
- local-network
########################
# Networks
########################
networks:
local-network:
driver: bridge
########################
# Volumes
########################
volumes:
postgres:
name: ${PROJECT_NAME}-${TAG}-vol-postgres
npmcache_app:
name: ${PROJECT_NAME}-${TAG}-vol-npmcache-app