-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
77 lines (73 loc) · 1.94 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# 1. Run tests:
# $> docker compose run --rm tests
#
# 2.1 Create coverage report. For example:
# $> docker exec tests coverage report
# $> docker exec tests coverage html
#
# 2.2 Run tests in watch mode. For example:
# $> docker exec tests ptw -- ./tests -s -x -vv --tb=long
# $> docker exec tests ptw -- ./tests/test_query.py::TestAggregate::test_syntactic_sugar_functions
services:
db:
container_name: db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: pg_isready
interval: 10s
timeout: 10s
retries: 3
start_period: 0s
image: postgis/postgis:15-3.4
ports:
- '5432:5432'
restart: on-failure
user: postgres
volumes:
- db:/var/lib/postgresql/data
hasura:
container_name: hasura
depends_on:
db:
condition: service_healthy
environment:
- HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- HASURA_GRAPHQL_METADATA_DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
- HASURA_GRAPHQL_ADMIN_SECRET=hasura
healthcheck:
test: curl -f http://0.0.0.0:$HASURA_PORT/healthz || exit 1
interval: 10s
timeout: 3s
retries: 3
start_period: 0s
image: hasura/graphql-engine:v2.12.1
ports:
- ${HASURA_PORT:-8080}:${HASURA_PORT:-8080}
restart: on-failure
tests:
build:
context: .
dockerfile: devDockerfile
command: >
bash -c 'python --version && pip freeze|grep ^pydantic= && coverage run -m pytest ./tests -v -m "not performance" --durations=10'
container_name: tests
depends_on:
db:
condition: service_healthy
hasura:
condition: service_healthy
environment:
- PY_COLORS=1
- FORCE_COLORS=1
env_file:
- .env.default
profiles:
- tests
volumes:
- .:/usr/src/app/
volumes:
db:
driver: local