-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker-compose-end2endtest.yml
105 lines (97 loc) · 2.52 KB
/
docker-compose-end2endtest.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# docker-compose-end2endtest.yml
version: '3.7'
services:
end2endtest:
build:
context: ./server/workers/tests
dockerfile: ./Dockerfile_tests
container_name: end2endtest
hostname: "end2endtest"
environment:
POSTGRES_USER: "testuser"
POSTGRES_PASSWORD: "testpassword"
POSTGRES_HOST: "test_db"
POSTGRES_PORT: 5432
DEFAULT_DATABASE: "testdb"
SERVICE_VERSION: "test_version"
ports:
- "0.0.0.0:5000:5000"
volumes:
- ./server/:/app
depends_on:
- db
- backend
restart: "no"
entrypoint: ["pytest", '/app/workers/tests/test_end2end.py', '-s', '-rfA']
networks:
- test
backend:
container_name: backend
hostname: "backend"
build:
context: ./server/workers/tests
dockerfile: ./Dockerfile_backend
volumes:
- ./server/:/var/www/html/server
- ./server/workers/tests/test_data/test.sqlite:/var/www/localstorage/test.sqlite
restart: "no"
networks:
- test
ports:
- "80:80"
api:
build:
context: server
dockerfile: workers/api/Dockerfile
restart: unless-stopped
environment:
SERVICE_VERSION: "test"
BEHIND_PROXY: "false"
DEFAULT_DATABASE: "testdb"
FLASK_ENV: "development"
volumes:
- ./server/workers/tests/mock_app.py:/app/mock_app.py
command: ["python", "mock_app.py"]
networks:
- test
persistence:
container_name: api
hostname: "test_api"
build:
context: server
dockerfile: workers/persistence/Dockerfile
restart: "no"
environment:
SERVICE_VERSION: "test"
BEHIND_PROXY: "false"
DEFAULT_DATABASE: "testdb"
FLASK_ENV: "development"
volumes:
- ./server/workers/tests/mock_app.py:/app/mock_app.py
command: ["python", "mock_app.py"]
networks:
- test
db:
container_name: test_db
image: 'postgres:12.2-alpine'
restart: "no"
hostname: "db_server"
environment:
POSTGRES_USER: "testuser"
POSTGRES_PASSWORD: "testpassword"
POSTGRES_HOST: "db_server"
POSTGRES_PORT: 5432
DEFAULT_DATABASE: "testdb"
command: postgres -c config_file=/etc/postgresql.conf -c hba_file=/etc/pg_hba.conf
volumes:
# - db_data:/var/lib/postgresql/data
- ./server/workers/tests/test_data/pg_hba_test_local.conf:/etc/pg_hba.conf
- ./server/workers/tests/test_data/postgresql_test_local.conf:/etc/postgresql.conf
ports:
- "5432:5432"
networks:
- test
volumes:
db_data:
networks:
test: