-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
70 lines (63 loc) · 1.47 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
version: '3'
services:
product:
container_name: product
build: ./product
restart: on-failure:5 # to wait for database
environment:
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_HOST=database
- PORT=${PORT}
- LOG_LEVEL=${LOG_LEVEL}
- GRPC_HOST=discount
- GRPC_PORT=${GRPC_PORT}
ports:
- "8080:8080"
depends_on:
- database
networks:
- connection
discount:
container_name: discount
build: ./discount
restart: on-failure:5 # to wait for database
environment:
- POSTGRESQL_URL=${POSTGRESQL_URL}
- GRPC_HOST=${GRPC_HOST}
- GRPC_PORT=${GRPC_PORT}
ports:
- "50051:50051"
depends_on:
- database
networks:
- connection
migrate:
image: migrate/migrate
restart: on-failure:5 # to wait for database
depends_on:
- database
networks:
- connection
volumes:
- ./migrations:/migrations
command: ["-path", "/migrations", "-database", "postgres://larien:lauren123@database:5432/product?sslmode=disable", "up"]
database:
image: postgres
networks:
- connection
container_name: database
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- "5433:5432"
volumes:
- data:/var/lib/postgresql/data
volumes:
data:
networks:
connection: