-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
58 lines (56 loc) · 1.4 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
services:
migrate-app:
image: migrate/migrate
container_name: "migrate-app"
networks:
- payment-processor-network
volumes:
- ./migrations/:/database
environment:
DATABASE_URI: ${DATABASE_URI:-postgresql://postgres:password@db:5432/postgres}
command: ["-path", "/database", "-database", "${DATABASE_URI}", "up"]
depends_on:
db:
condition: service_healthy
app:
container_name: "payment-processor"
restart: on-failure
build:
context: .
dockerfile: Dockerfile
networks:
- payment-processor-network
ports:
- "3000:3000"
volumes:
- .:/usr/src/app
environment:
DATABASE_URI: ${DATABASE_URI:-postgresql://postgres:password@db:5432/postgres}
PORT: ${PORT:-3000}
TEST_URL: ${TEST_URL:-http://localhost}
depends_on:
db:
condition: service_healthy
db:
image: postgres
container_name: "payment-proccesor-db"
restart: on-failure
networks:
- payment-processor-network
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
networks:
payment-processor-network:
driver: bridge
volumes:
db-data: