-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (48 loc) · 1.12 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
version: '3.7'
services:
### Services
service-main:
build:
context: ./
ports:
- ${SERVICE_API_PORT:-3000}:${SERVICE_API_PORT:-3000}
environment:
PORT: ${SERVICE_API_PORT:-3000}
depends_on:
- migrate
- db
env_file:
- ./docker.env
command: bash -c 'npm run wait:db & npm run wait:migrate & wait && npm run service:main'
service-api:
build:
context: ./
ports:
- ${SERVICE_API_PORT:-3000}:${SERVICE_API_PORT:-3000}
environment:
PORT: ${SERVICE_API_PORT:-3000}
depends_on:
- migrate
- db
env_file:
- ./docker.env
command: bash -c 'npm run wait:db & npm run wait:migrate & wait && npm run service:api'
### Dependencies
db:
image: postgres:12.6-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pwdpostgre
POSTGRES_DB: amon-test
POSTGRES_HOST_AUTH_METHOD: password
ports:
- 5432:5432
### Tools
migrate:
build:
context: ./
depends_on:
- db
env_file:
- ./docker.env
command: bash -c 'npm run wait:db && npm run db:migrate up'