-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (76 loc) · 1.54 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: "3.9"
services:
accounts-api:
build:
context: ./accounts
dockerfile: Dockerfile
container_name: accounts-api
depends_on:
- database
networks:
- stc
ports:
- "3333:3333"
env_file:
- ./accounts/.env
restart: always
command: server
login-api:
build:
context: ./login
dockerfile: Dockerfile
container_name: login-api
networks:
- stc
ports:
- "3335:3335"
env_file:
- ./login/.env
restart: always
command: server
transfers-api:
build:
context: ./transfers
dockerfile: Dockerfile
container_name: transfers-api
depends_on:
- database
networks:
- stc
ports:
- "3334:3334"
env_file:
- ./transfers/.env
restart: always
command: server
database:
image: 'postgres:9.6.6'
environment:
POSTGRES_USER: stchallenge
POSTGRES_PASSWORD: stchallenge
POSTGRES_DB: stchallenge
networks:
- stc
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
container_name: stc-db
migrate:
build:
context: .
dockerfile: Dockerfile.migrate
command: [ "-path", "/migrations", "-database", "postgres://stchallenge:stchallenge@database:5432/stchallenge?sslmode=disable", "-verbose", "up" ]
networks:
- stc
depends_on:
database:
condition: service_healthy
links:
- database
networks:
stc:
name: stc