-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.test.yml
45 lines (43 loc) · 1.09 KB
/
docker-compose.test.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
---
version: "3.9"
services:
# https://github.com/docker-library/docs/blob/master/postgres/README.md
# https://geshan.com.np/blog/2021/12/docker-postgres/
postgres:
image: app-db:latest
# image: postgres:14
# image: postgres:14.1-alpine
restart: always
ports:
- '5432:5432'
# hostname: db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=app_test
volumes:
- postgres_data_path:/var/lib/postgresql/data
# - ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
healthcheck:
# test: ["CMD-SHELL", "pg_isready -U postgres -d app_test"]
test: ["CMD-SHELL", "pg_isready"]
start_period: 5s
interval: 2s
timeout: 5s
retries: 20
test:
image: test:latest
environment:
- MIX_ENV=test
- DATABASE_URL
- DATABASE_HOST=postgres
- DATABASE_DB
depends_on:
postgres:
condition: service_healthy
# - postgres
volumes:
- "./junit-reports:/app/_build/test/junit-reports"
volumes:
postgres_data_path:
driver: local