-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdocker-compose.yml
58 lines (53 loc) · 1.08 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
version: '3.8'
services:
adminer:
image: adminer
restart: always
ports:
- 8080:8080
networks:
- go-network
postgresdb:
image: postgres:alpine
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
timeout: 20s
retries: 10
ports:
- ${DB_PORT}:5432
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
volumes:
- dbdata:/var/lib/postgresql/data
- ./src/database/init:/docker-entrypoint-initdb.d
networks:
- go-network
go-app:
build: .
image: go-app
ports:
- ${APP_PORT}:3000
depends_on:
postgresdb:
condition: service_healthy
volumes:
- .:/usr/src/go-app
restart: on-failure
env_file:
- .env
networks:
- go-network
healthcheck:
test: ["CMD", "curl", "-f", "${APP_URL}/v1/health-check"]
interval: 40s
timeout: 30s
retries: 3
start_period: 30s
volumes:
dbdata:
networks:
go-network:
driver: bridge