generated from yandex-praktikum/go-musthave-diploma-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (63 loc) · 1.46 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
---
version: "3.8"
services:
postgres:
image: postgres:${POSTGRES_VERSION}
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
TZ: ${TZ}
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- 5432:5432
migrate:
image: migrate/migrate
volumes:
- ./migrations:/migrations
command:
[
"-path",
"/migrations",
"-database",
"postgres://postgres:5432/${POSTGRES_DB}?user=${POSTGRES_USER}&password=${POSTGRES_PASSWORD}&sslmode=disable",
"-verbose",
"up",
]
depends_on:
postgres:
condition: service_healthy
api:
build:
# context: .
# dockerfile: Dockerfile
# target: final
args:
APP_NAME: gophermart
environment:
API_PORT: ${API_PORT}
DATABASE_DSN: ${DATABASE_DSN}
LOGS_FORMAT: console
TZ: ${TZ}
depends_on:
postgres:
condition: service_healthy
ports:
- ${API_PORT}:${API_PORT}
expose:
- ${API_PORT}
healthcheck:
test: ["CMD", "wget", "-nv", "-t1", "--spider", "http://localhost:${API_PORT}/health"]
start_period: 5s
interval: 30s
timeout: 5s
retries: 3
#depends_on:
# postgresql:
# condition: service_healthy
# env_file:
# - .env