/
docker-compose.yml
122 lines (115 loc) · 3.53 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
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
113
114
115
116
117
118
119
120
121
122
version: "3.7"
services:
#---------------------------------------------
# Postgres DB
#---------------------------------------------
db:
image: "postgres:15"
environment:
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres-data:/var/lib/postgresql/data/
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"]
interval: 10s
timeout: 5s
retries: 10
#---------------------------------------------
# Historic data
#---------------------------------------------
historic-data:
image: ghcr.io/gsa-tts/fac-historic-public-csvs/load-historic-public-data:20230912
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: postgres://postgres@db/postgres
#---------------------------------------------
# Django app
#---------------------------------------------
web:
build:
context: .
dockerfile: "./${DOCKERFILE:-Dockerfile}"
command: /src/run.sh
depends_on:
db:
condition: service_healthy
minio:
condition: service_started
clamav-rest:
condition: service_started
api:
condition: service_started
environment:
DATABASE_URL: postgres://postgres@db/postgres
POSTGREST_URL: http://api:3000
DJANGO_DEBUG: true
SAM_API_KEY: ${SAM_API_KEY}
DJANGO_BASE_URL: http://localhost:8000
DJANGO_SECRET_LOGIN_KEY: ${DJANGO_SECRET_LOGIN_KEY}
LOGIN_CLIENT_ID: ${LOGIN_CLIENT_ID}
ENV: ${ENV}
SECRET_KEY: ${SECRET_KEY}
ALLOWED_HOSTS: 0.0.0.0 127.0.0.1 localhost
AV_SCAN_URL: http://clamav-rest:${CLAMAV_PORT:-9000}/scan
DISABLE_AUTH: ${DISABLE_AUTH:-False}
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET:-32_chars_fallback_secret_testing}
ENABLE_DEBUG_TOOLBAR: false
env_file:
- ".env"
ports:
- "8000:8000"
volumes:
- .:/src
- /src/node_modules
- /src/staticfiles
#---------------------------------------------
# ClamAV virus scanner
#---------------------------------------------
clamav-rest:
image: ghcr.io/gsa-tts/fac/clamav:latest
environment:
MAX_FILE_SIZE: 30M
SIGNATURE_CHECKS: 1
PORT: ${CLAMAV_PORT:-9000}
ports:
- ${CLAMAV_PORT:-9000}:${CLAMAV_PORT:-9000}
#---------------------------------------------
# Minio (S3 clone)
#---------------------------------------------
minio:
container_name: "minio"
image: minio/minio
command: server /tmp/minio --console-address ":9002"
ports:
- "9001:9000"
- "9002:9002"
volumes:
- "minio-vol:/tmp/minio"
#---------------------------------------------
# PostgREST API provider
#---------------------------------------------
api:
image: ghcr.io/gsa-tts/fac/postgrest:latest
ports:
- "3000:3000"
expose:
- "3000"
environment:
PGRST_DB_URI: postgres://postgres@db:5432/postgres
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
PGRST_DB_ANON_ROLE: anon
# See https://postgrest.org/en/stable/references/api/schemas.html#multiple-schemas for multiple schemas
PGRST_DB_SCHEMAS: "api_v1_0_3, api_v1_1_0, admin_api_v1_1_0"
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET:-32_chars_fallback_secret_testing} # Fallback value for testing environments
# Enable this to inspect the DB plans for queries via EXPLAIN
PGRST_DB_PLAN_ENABLED: ${PGRST_DB_PLAN_ENABLED:-false}
depends_on:
db:
condition: service_healthy
volumes:
postgres-data:
minio-vol: