Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
112 lines (104 loc) · 2.84 KB
/
Copy pathcompose.yaml
File metadata and controls
112 lines (104 loc) · 2.84 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: pure-auto-codeql
x-app: &app
# CodeQL CLI publishes linux64 binaries; ARM hosts run this image via emulation.
platform: linux/amd64
build:
context: .
dockerfile: docker/Dockerfile.app
user: "${PUID:-1000}:${PGID:-1000}"
environment: &app-environment
DATABASE_URL: postgresql+asyncpg://pure_codeql:pure_codeql@postgres:5432/pure_codeql
REDIS_URL: redis://redis:6379/0
API_AUTH_TOKEN: ${API_AUTH_TOKEN:-change-me-before-production}
API_HOST: 0.0.0.0
HOME: /tmp/pure-auto-codeql-home
XDG_CACHE_HOME: /tmp/pure-auto-codeql-cache
volumes:
- ./projects:/app/projects
- ./output:/app/output
- ./config:/app/config:ro
tmpfs:
- /tmp:rw,noexec,nosuid,size=1g
- /app/temp:rw,noexec,nosuid,size=2g
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
pids_limit: 512
mem_limit: 4g
cpus: 2
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: pure_codeql
POSTGRES_USER: pure_codeql
POSTGRES_PASSWORD: pure_codeql
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pure_codeql -d pure_codeql"]
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:8-alpine
command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
migrate:
platform: linux/amd64
build:
context: .
dockerfile: docker/Dockerfile.app
command: ["alembic", "upgrade", "head"]
environment:
<<: *app-environment
depends_on:
postgres:
condition: service_healthy
api:
<<: *app
command: ["uvicorn", "pure_auto_codeql.api.server:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "2"]
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health')"]
interval: 10s
timeout: 5s
retries: 12
worker:
<<: *app
command: ["python", "-m", "pure_auto_codeql.worker"]
healthcheck:
test: ["CMD", "python", "-m", "pure_auto_codeql.worker", "--healthcheck"]
interval: 15s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
profiles: ["s3"]
command: ["server", "/data", "--console-address", ":9001"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minio}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minio-change-me}
volumes:
- minio-data:/data
ports:
- "9000:9000"
- "9001:9001"
volumes:
postgres-data:
redis-data:
minio-data: