Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
176 lines (171 loc) · 6.8 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
176 lines (171 loc) · 6.8 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
services:
reverse-proxy:
image: traefik:v3.7
command:
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.network=thesis-management-network"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.letsencrypt.acme.email=admin@tum.de"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
# Incident mode: ./traefik-dynamic/incident.yml defines incident-gate and
# incident-gate-api, which the client and server routers always use. It is
# managed by aet-infrastructure (services/thesis_management): open to
# everyone normally, VPN-only during an incident. If the file is missing
# the routers are disabled, so the app fails closed, never open.
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt:/letsencrypt
- ./traefik-dynamic:/etc/traefik/dynamic:ro
networks:
- thesis-management-network
server:
image: "ghcr.io/ls1intum/thesis-management/thesis-management-server:${SERVER_IMAGE_TAG}"
container_name: thesis-management-server
labels:
- "traefik.enable=true"
- "traefik.http.routers.server.rule=Host(`${APP_HOSTNAME}`) && PathPrefix(`/api`)"
- "traefik.http.services.server.loadbalancer.server.port=8080"
- "traefik.http.routers.server.entrypoints=websecure"
- "traefik.http.routers.server.tls.certresolver=letsencrypt"
- "traefik.http.middlewares.api-ratelimit.ratelimit.average=300"
- "traefik.http.middlewares.api-ratelimit.ratelimit.burst=100"
- "traefik.http.middlewares.server-compress.compress=true"
# Tell browsers to use https only for this host (sent on https responses only). Deliberately without
# includeSubdomains and preload: the parent domain hosts other services this project does not own.
# Each container defines its own middleware: Traefik drops a container's labels while it is down, and a
# router that references a missing middleware is disabled, so the two routers must not share one.
- "traefik.http.middlewares.server-hsts.headers.stsSeconds=31536000"
- "traefik.http.routers.server.middlewares=incident-gate-api@file,api-ratelimit,server-compress,server-hsts"
- "traefik.http.routers.server.priority=10"
depends_on:
db:
condition: service_healthy
volumes:
- ./thesis_uploads:/uploads
restart: unless-stopped
expose:
- "8080"
environment:
- TZ=Europe/Berlin
- SPRING_JPA_HIBERNATE_DDL_AUTO=validate
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/${SPRING_DATASOURCE_DATABASE}
- MAIL_ENABLED=true
- POSTFIX_HOST=postfix
- POSTFIX_PORT=25
- UPLOAD_FOLDER=/uploads
- DEBUG_MODE=false
# take from docker environment
- SPRING_DATASOURCE_USERNAME
- SPRING_DATASOURCE_PASSWORD
- POSTFIX_USERNAME
- POSTFIX_PASSWORD
- CLIENT_HOST
- KEYCLOAK_HOST
- KEYCLOAK_REALM_NAME
- KEYCLOAK_SERVICE_CLIENT_ID
- KEYCLOAK_SERVICE_CLIENT_SECRET
- MAIL_SENDER
# Pre-fills schools, departments and study programs on first start (e.g. `tum`); empty for none
- REFERENCE_DATA_PRESET
# Shared with the client below: gates the AI feedback module. Both services must agree,
# otherwise the client shows AI buttons the server answers with 404 (or vice versa).
- AI_FEATURES_ENABLED
# LLM backend for the AI feedback module. Only consulted when AI_FEATURES_ENABLED=true;
# each is optional and falls back to the application.yml default when unset.
- OPENAI_API_KEY
- OPENAI_BASE_URL
- OPENAI_CHAT_MODEL
- OPENAI_CHAT_TEMPERATURE
- OPENAI_TIMEOUT
- AI_REVIEW_INCLUDE_IMAGES
networks:
- thesis-management-network
client:
image: "ghcr.io/ls1intum/thesis-management/thesis-management-client:${CLIENT_IMAGE_TAG}"
container_name: thesis-management-client
labels:
- "traefik.enable=true"
- "traefik.http.routers.client.rule=Host(`${APP_HOSTNAME}`)"
- "traefik.http.routers.client.entrypoints=websecure"
- "traefik.http.routers.client.tls.certresolver=letsencrypt"
- "traefik.http.middlewares.client-compress.compress=true"
- "traefik.http.middlewares.client-hsts.headers.stsSeconds=31536000"
- "traefik.http.routers.client.middlewares=incident-gate@file,client-compress,client-hsts"
- "traefik.http.routers.client.priority=1"
restart: unless-stopped
# Maintenance banner (MAINTENANCE_MESSAGE), written by aet-infrastructure.
# Optional, and deliberately not listed under environment: a bare entry
# there would override this file with an empty value.
env_file:
- path: ./incident.env
required: false
expose:
- "80"
environment:
- SERVER_HOST
- KEYCLOAK_HOST
- KEYCLOAK_REALM_NAME
- KEYCLOAK_CLIENT_ID
- PASSKEY_RP_ID
- PASSKEY_RP_NAME
- PASSKEY_PROMPT_APPS
- ALLOW_SUGGESTED_TOPICS
# Shared with the server above: must match so AI buttons are only shown when the
# server actually serves the /v2/ai-review endpoints.
- AI_FEATURES_ENABLED
- THESIS_TYPES
- THESIS_PORTAL_URL
- STUDY_DEGREES
- GENDERS
- LANGUAGES
- CUSTOM_DATA
- THESIS_FILES
- APPLICATION_TITLE
- CHAIR_NAME
- CHAIR_URL
depends_on:
- server
networks:
- thesis-management-network
db:
image: "postgres:${POSTGRES_IMAGE_TAG:-19.0-alpine}"
container_name: thesis-management-db
environment:
- POSTGRES_USER=${SPRING_DATASOURCE_USERNAME}
- POSTGRES_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
- PGDATA=/var/lib/postgresql/data
volumes:
- ./postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${SPRING_DATASOURCE_USERNAME}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- thesis-management-network
postfix:
image: ghcr.io/ls1admin/postfix:latest
container_name: thesis-management-postfix
volumes:
- ./postfix-config:/config
hostname: ${APP_HOSTNAME}
restart: unless-stopped
networks:
- thesis-management-network
networks:
# Create network manually in advance: docker network create thesis-management-network
thesis-management-network:
name: thesis-management-network
external: true