-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (59 loc) · 1.18 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
version: '3'
services:
frontend:
image: nginx:alpine
volumes:
- ./front:/usr/share/nginx/html
ports:
- "8081:80"
depends_on:
- web
web:
build:
context: .
dockerfile: Dockerfile
image: quiz-pet-app
ports:
- "8080:8080"
depends_on:
- db
env_file:
- .env
db:
container_name: "pet-postgres"
image: postgres:latest
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
ports:
- "5433:5432"
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 5s
timeout: 5s
retries: 5
migrate:
image: migrate/migrate:v4.15.2
profiles: ["tools"]
volumes:
- ./migrations:/migrations
entrypoint:
[
"migrate",
"-path",
"/migrations",
"-database",
"postgresql://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}?sslmode=disable",
]
command: ["up"]
depends_on:
db:
condition: service_healthy
restart: on-failure
volumes:
postgres_data: