-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (43 loc) · 1.03 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
version: "3.8"
services:
go_rest_comments_api_db:
image: postgres:12.2-alpine
container_name: "go-rest-comments-api-db"
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- go_rest_comments_network
volumes:
- database_postgres:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
go_rest_comments_api:
build: .
container_name: "go-rest-comments-api"
environment:
DB_USERNAME: "postgres"
DB_PASSWORD: "postgres"
DB_DB: "postgres"
DB_HOST: "go_rest_comments_api_db"
DB_TABLE: "postgres"
DB_PORT: "5432"
SSL_MODE: "disable"
ports:
- "8080:8080"
depends_on:
go_rest_comments_api_db:
condition: service_healthy
networks:
- go_rest_comments_network
volumes:
database_postgres:
networks:
go_rest_comments_network:
driver: bridge