-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (120 loc) · 2.83 KB
/
docker-compose.yml
File metadata and controls
128 lines (120 loc) · 2.83 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
123
124
125
126
127
128
version: '3.8'
networks:
app-network:
driver: bridge
services:
api_prod:
restart: on-failure
container_name: map-sorter-api-prod
# image: high10hunter/node:latest
# Uncomment the line below to run on mac os
# platform: linux/arm64/v8
build:
context: .
dockerfile: Dockerfile
environment:
- NODE_ENV=production
ports:
- '3000:3000'
expose:
- '3000'
env_file:
- .env
db:
container_name: postgres-db
image: postgis/postgis:16-3.4-alpine
restart: on-failure
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=MapSorter
ports:
- '5432:5432'
networks:
- app-network
base:
build:
dockerfile: base.Dockerfile
image: base
# Uncomment the line below to run on mac os
# platform: linux/arm64/v8
environment:
- TYPEORM_HOST=postgres-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=MapSorter
env_file:
- .env
depends_on:
- db
networks:
- app-network
# rabbitmq:
# image: rabbitmq:3-management
# container_name: rabbitmq
# hostname: rabbitmq
# ports:
# - '5672:5672'
# - '15672:15672'
# env_file:
# - ./rabbitmq.env
# networks:
# - app-network
init_db:
image: base
# Uncomment the line below to run on mac os
# platform: linux/arm64/v8
environment:
- TYPEORM_HOST=postgres-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=MapSorter
env_file:
- .env
depends_on:
- db
- base
volumes:
- ./scripts/wait-for-it.sh:/home/app/scripts/wait-for-it.sh
# Uncomment the line below to fix the argon2 error
# command: sh -c "npm rebuild argon2 --build-from-source && npm run typeorm:run-migration && npm run seed:run"
command:
[
'./scripts/wait-for-it.sh',
'postgres-db:5432',
'--timeout=30',
'--',
'sh',
'-c',
'npm run typeorm:migration-localrun && npm run seed:run',
]
networks:
- app-network
api_dev:
image: base
container_name: map-sorter-api-dev
# Uncomment the line below to run on mac os
# platform: linux/arm64/v8
# Uncomment the line below to fix the argon2 error
# command: sh -c "npm rebuild argon2 --build-from-source && npm run start:dev"
env_file:
- .env
environment:
- TYPEORM_HOST=postgres-db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=MapSorter
ports:
- '3000:3000'
expose:
- '3000'
depends_on:
- db
- base
- init_db
volumes:
- ./:/home/app/
- /home/app/node_modules
command: sh -c "npm run start:dev"
networks:
- app-network