-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (52 loc) · 1.12 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
version: '3'
services:
postgres:
image: postgres:latest
build:
context: ./database
dockerfile: Dockerfile
container_name: postgres
ports:
- 5432:5432
env_file:
- ./backend/app.env
healthcheck:
test: pg_isready -U root -d contact_db
interval: 10s
timeout: 3s
retries: 5
migrate:
image: migrate/migrate:v4.15.2
volumes:
- ./backend/db/migration:/migrations
command: ["-path", "/migrations", "-database", "postgresql://root:secret@postgres:5432/contact_db?sslmode=disable", "up"]
restart: on-failure
depends_on:
- postgres
web:
build: ./nginx
ports:
- 80:80
depends_on:
- api
api:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- 8080:8080
depends_on:
migrate:
condition: service_completed_successfully
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/contact_db?sslmode=disable
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- 3000:3000
depends_on:
- api
volumes:
db: