Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (81 loc) · 2.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (81 loc) · 2.62 KB
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
---
version: "3.9"
services:
database:
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-insecure}
MONGODB_DATABASE: pubcode
image: ghcr.io/bcgov/nr-containers/mongo:7.0.43
ports: ["27017:27017"]
restart: unless-stopped
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand({ ping: 1 })"]
interval: 5s
timeout: 5s
retries: 20
mongo-express: # The admin UI container for mongoDB
image: mongo-express
restart: unless-stopped
ports:
- "8001:8081"
environment:
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
ME_CONFIG_MONGODB_AUTH_DATABASE: db
ME_CONFIG_MONGODB_AUTH_USERNAME: default
ME_CONFIG_MONGODB_AUTH_PASSWORD: default
ME_CONFIG_MONGODB_ADMINUSERNAME: default
ME_CONFIG_MONGODB_ADMINPASSWORD: default
# Compose can't percent-encode, so a MONGO_PASSWORD override must be URL-safe for this UI
ME_CONFIG_MONGODB_URL: mongodb://admin:${MONGO_PASSWORD:-insecure}@database:27017/
depends_on:
database:
condition: service_healthy
api:
image: pub-code-api:latest
build:
context: api
environment:
DB_HOST: database
DB_USER: admin
DB_PWD: ${MONGO_PASSWORD:-insecure}
DB_NAME: pubcode
# The API won't start without CHES settings. These placeholders let it
# start; set real values in your shell to send email locally.
CHES_TOKEN_URL: ${CHES_TOKEN_URL:-http://localhost/ches/token}
CHES_CLIENT_ID: ${CHES_CLIENT_ID:-placeholder}
CHES_CLIENT_SECRET: ${CHES_CLIENT_SECRET:-placeholder}
CHES_API_URL: ${CHES_API_URL:-http://localhost/ches}
ports:
- "3005:3000"
restart: unless-stopped
# The image is distroless (no curl), so check with Node instead
healthcheck:
test: ["CMD", "/nodejs/bin/node", "-e", "fetch('http://localhost:3000/').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 5s
timeout: 5s
retries: 20
depends_on:
database:
condition: service_healthy
#Run npm run build-watch in local before this.
frontend:
image: caddy:2.11.8-alpine
working_dir: /app
environment:
BACKEND_URL: http://api:3000
LOG_LEVEL: info
volumes:
- ./frontend/Caddyfile:/etc/caddy/Caddyfile
- ./frontend/dist:/app/dist
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
interval: 5s
timeout: 5s
retries: 20
depends_on:
api:
condition: service_healthy
ports:
- "3002:3000"
restart: unless-stopped