Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (101 loc) · 2.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
113 lines (101 loc) · 2.72 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: vulnerablecode
x-app-volume: &app-volume /etc/vulnerablecode/:/etc/vulnerablecode/
x-app-common: &app-common
image: vulnerablecode:${VULNERABLECODE_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile
env_file:
- docker.env
volumes:
- *app-volume
services:
db:
image: postgres:15
command: -c config_file=/etc/postgresql/postgresql.conf
env_file:
- docker.env
volumes:
- db_data:/var/lib/postgresql/data/
- ./etc/postgresql/postgresql.conf:/etc/postgresql/postgresql.conf
shm_size: 1gb
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
vulnerablecode_redis:
image: docker.io/library/redis:8.10.3-alpine
volumes:
- vulnerablecode_redis_data:/data
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
vulnerablecode:
<<: *app-common
command: /bin/sh -c "
./manage.py migrate &&
./manage.py collectstatic --no-input --verbosity 0 --clear &&
gunicorn vulnerablecode.wsgi:application -u nobody -g nogroup --bind :8000 --timeout 600 --workers 8"
expose:
- 8000
volumes:
- *app-volume
- static:/var/vulnerablecode/static/
restart: always
depends_on:
db:
condition: service_healthy
vulnerablecode_scheduler:
<<: *app-common
command: wait-for-it web:8000 -- python ./manage.py run_scheduler
depends_on:
db:
condition: service_healthy
vulnerablecode:
condition: service_started
vulnerablecode_redis:
condition: service_healthy
vulnerablecode_rqworker:
<<: *app-common
command: wait-for-it web:8000 -- python ./manage.py rqworker default
depends_on:
db:
condition: service_healthy
vulnerablecode:
condition: service_started
vulnerablecode_redis:
condition: service_healthy
vulnerablecode_rqworker_high:
<<: *app-common
command: wait-for-it web:8000 -- python ./manage.py rqworker high
depends_on:
db:
condition: service_healthy
vulnerablecode:
condition: service_started
vulnerablecode_redis:
condition: service_healthy
nginx:
image: docker.io/library/nginx:1.31.9-alpine
ports:
- 80:80
- 443:443
env_file:
- docker.env
volumes:
- ./etc/nginx/conf.d/:/etc/nginx/conf.d/
- static:/var/vulnerablecode/static/
- /var/www/html:/var/www/html
restart: always
depends_on:
vulnerablecode:
condition: service_started
volumes:
db_data:
static:
vulnerablecode_redis_data: