-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-for-e2e.yaml
43 lines (40 loc) · 1.16 KB
/
docker-compose-for-e2e.yaml
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
version: "3.9"
services:
server:
image: "expense_tracker/server:latest"
build:
context: ./..
dockerfile: app_to_test/server/Dockerfile
environment:
DB_URL: "postgres://postgres:secret123@db:5432/expense_tracker?sslmode=disable"
BANK_API_URL: "${BANK_API_URL}"
depends_on:
db:
condition: service_healthy
# Thanks to this container can call our mock HTTP server on host machine.
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
# Once again, we use a random port to avoid conflicts.
- "8000"
db:
image: "postgres:15.2-alpine"
environment:
POSTGRES_DB: expense_tracker
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret123
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 3s
timeout: 60s
retries: 10
start_period: 5s
migrate:
image: "expense_tracker/migrate:latest"
build:
context: ./../app_to_test/db
environment:
DB_URL: "postgres://postgres:secret123@db:5432/expense_tracker?sslmode=disable"
depends_on:
db:
condition: service_healthy