-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-tests.yml
44 lines (39 loc) · 1.11 KB
/
docker-compose-tests.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
version: '3.8'
services:
api:
build:
context: .
dockerfile: Dockerfile.eas-api
command: bash -c 'cd /eas/emergency-alerts-api && . /venv/eas-api/bin/activate && make test'
depends_on:
- pg
networks:
- test-network
pg:
image: postgres:14
container_name: postgres-for-api-tests
restart: always
environment:
POSTGRES_PASSWORD: root
POSTGRES_USER: postgres
POSTGRES_DB: postgres
USER: $USER
volumes:
- ./postgres:/docker-entrypoint-initdb.d:ro
networks:
- test-network
ports:
- 5432:5432
networks:
test-network:
driver: bridge
# Running tests in a container
# docker compose -f docker-compose-tests.yml up --force-recreate --exit-code-from api
# docker compose -f docker-compose-tests.yml down
# To start postgres to run tests from local api directory,
# use the following commands:
# cd /eas/emergency-alerts-api && . /venv/eas-api/bin/activate
# docker compose -f docker-compose-tests.yml up --force-recreate -d pg
# . ./environment.sh && make test
# Optional:
# docker compose -f docker-compose-tests.yml down