-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (115 loc) · 2.91 KB
/
docker-compose.yml
File metadata and controls
122 lines (115 loc) · 2.91 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
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
# API
services:
postgrex:
container_name: postgrex-mono
build:
context: apps/api/tools/docker/db
dockerfile: Dockerfile
args:
- CRON_DATABASE_NAME=${DATABASE_NAME}
restart: unless-stopped
expose:
- 5432
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
- POSTGRES_USER=${DATABASE_USER}
networks:
- airgradient-map-prod
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME}"]
interval: 5s
timeout: 5s
retries: 5
db-migrate:
container_name: db-migrate-mono
image: "mapapi-mono:${IMAGE_TAG}"
command: npx knex migrate:latest --knexfile knexfile.ts
networks:
- airgradient-map-prod
volumes:
- ./apps/api/database:/app/database
- ./apps/api/knexfile.ts:/app/knexfile.ts
env_file:
- ./apps/api/.env
depends_on:
postgrex:
condition: service_healthy
restart: on-failure
mapapi:
image: "mapapi-mono:${IMAGE_TAG}"
container_name: mapapi-mono
build:
context: apps/api
dockerfile: tools/docker/Dockerfile
target: production
restart: unless-stopped
ports:
- 3001:3001
networks:
- airgradient-map-prod
env_file:
- ./apps/api/.env
depends_on:
db-migrate:
condition: service_completed_successfully
postgrex:
condition: service_healthy
environment:
- NODE_ENV=production
- PM2_INSTANCE=2 # Default
command: ["pm2-runtime", "start", "dist/api-main.js", "-i", "${PM2_INSTANCE}", "--name", "mapapi"]
cron:
image: "mapapi-mono:${IMAGE_TAG}" # prevent rebuild
container_name: cron-mono
restart: unless-stopped
networks:
- airgradient-map-prod
env_file:
- ./apps/api/.env
depends_on:
db-migrate:
condition: service_completed_successfully
postgrex:
condition: service_healthy
environment:
- NODE_ENV=production
command: node dist/cron-main
app:
image: "website-mono:${IMAGE_TAG}"
container_name: website-mono
build:
context: apps/website
args:
- APP_ENV=production
restart: unless-stopped
ports:
- "3000:80"
environment:
- APP_ENV=production
- HOST=0.0.0.0
- PORT=80
- NUXT_PUBLIC_TRUSTED_CONTEXT=${DATA_PERMISSION_CONTEXT_HEADER}
wind-service:
image: "wind-service-mono:${IMAGE_TAG}"
container_name: wind-service-mono
build:
context: apps/wind-service
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- ./apps/api/.env
networks:
- airgradient-map-prod
depends_on:
db-migrate:
condition: service_completed_successfully
postgrex:
condition: service_healthy
networks:
airgradient-map-prod:
driver: bridge
volumes:
pgdata: