-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose-test.yml
More file actions
96 lines (90 loc) · 2.4 KB
/
docker-compose-test.yml
File metadata and controls
96 lines (90 loc) · 2.4 KB
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
# Uses Compose Specification (https://github.com/compose-spec/compose-spec/blob/master/spec.md)
#
# This compose file is specifically for running E2E tests in production mode.
# It combines production build settings with a test database for isolation.
services:
app:
build:
context: .
dockerfile: ./web-app/Dockerfile
target: prod
container_name: vim-app
volumes:
- ./web-app/django:/virtual-instrument-museum/vim-app
- vim-static:/virtual-instrument-museum/static
- vim-media:/virtual-instrument-museum/media
depends_on:
postgres-test:
condition: service_healthy
environment:
- MODE=test
- TEST_POSTGRES_DB=${TEST_POSTGRES_DB}
- TEST_POSTGRES_USER=${TEST_POSTGRES_USER}
- TEST_POSTGRES_PASSWORD=${TEST_POSTGRES_PASSWORD}
- HOST_NAME=${HOST_NAME}
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import socket; s = socket.socket(); s.connect(('localhost', 8001)); s.close()",
]
interval: 5s
timeout: 3s
retries: 12
start_period: 10s
postgres-test:
image: postgres:15.4
container_name: vim-db-test
environment:
- POSTGRES_DB=${TEST_POSTGRES_DB}
- POSTGRES_USER=${TEST_POSTGRES_USER}
- POSTGRES_PASSWORD=${TEST_POSTGRES_PASSWORD}
ports:
- "5433:5432"
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: "pg_isready -U ${TEST_POSTGRES_USER} -d ${TEST_POSTGRES_DB}"
interval: 10s
timeout: 5s
retries: 5
nginx:
build: ./nginx
container_name: vim-nginx
restart: unless-stopped
environment:
- HOST_NAME=${HOST_NAME}
- APP_HOST=vim-app
ports:
- "8000:80"
volumes:
- ./web-app/frontend/assets/:/virtual-instrument-museum/frontend/assets/
- vim-static:/virtual-instrument-museum/static
- vim-media:/virtual-instrument-museum/media
depends_on:
app:
condition: service_healthy
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 5s
timeout: 3s
retries: 6
start_period: 5s
solr:
build: ./solr
container_name: vim-solr
restart: unless-stopped
ports:
- "8983:8983"
volumes:
- umil-solr:/var/solr
- ./solr/cores:/var/solr/data
networks:
vim-net:
volumes:
vim-static:
vim-media:
umil-solr: