Repository navigation
Expand file tree
/
Copy pathdocker-compose.showcase.yml
More file actions
161 lines (155 loc) · 6.93 KB
/
Copy pathdocker-compose.showcase.yml
File metadata and controls
161 lines (155 loc) · 6.93 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
# Single-command demo deployment of the Thesis Management platform.
#
# Spins up the full stack from published container images:
# - PostgreSQL (data service)
# - Keycloak with the imported realm and seeded test users (identity provider)
# - Mailpit (captures all outgoing emails for inspection)
# - Spring Boot application server (with `dev` profile -> Liquibase dev seed data)
# - React web app (served by nginx, runtime-injected env)
#
# Usage:
# docker compose -f docker-compose.showcase.yml up -d
# open http://localhost:3100
#
# Log in with one of the seeded users (password = username):
# admin, examiner, examiner2, supervisor, supervisor2, student, student2 ...
# See the "Test Users and Roles" section of documentation/docs/developer/development-setup.mdx for the full list.
# Captured emails are at http://localhost:8125 (Mailpit web UI).
#
# This deployment is for evaluation and demos only. It uses default secrets,
# an unhardened Keycloak realm (the same one used for local dev), and seeds
# fake data into the database. Do NOT expose it on a public network and do NOT
# point it at a production PostgreSQL.
#
# Port note: this file reuses the same host ports as `docker-compose.yml`
# (5444, 8181, 8125, 1125, 8180, 3100). If you are already running the
# regular dev compose, run `docker compose down` first — the two stacks
# cannot run side by side.
#
# Tag note: images are pulled by `:latest`. For a reproducible demo, pin to
# a specific version once you have one that works (see GitHub Releases).
services:
db:
image: 'postgres:${POSTGRES_IMAGE_TAG:-19.0-alpine}'
container_name: thesis-management-showcase-db
environment:
POSTGRES_USER: thesis-management-postgres
POSTGRES_PASSWORD: thesis-management-postgres
POSTGRES_DB: thesis-management
volumes:
- showcase_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d thesis-management -U thesis-management-postgres"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "5444:5432"
keycloak:
build:
context: .
dockerfile: keycloak/Dockerfile
container_name: thesis-management-showcase-keycloak
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
# Pin the public hostname so the `iss` claim Keycloak issues is stable
# across the in-Docker application server (reaches Keycloak at
# http://keycloak:8080) and the host-side browser (reaches Keycloak at
# http://localhost:8181). Without this, JWT issuer validation fails.
KC_HOSTNAME: http://localhost:8181
KC_HOSTNAME_STRICT: "false"
KC_HTTP_ENABLED: "true"
volumes:
- ./keycloak/thesis-management-realm.json:/opt/keycloak/data/import/thesis-management-realm.json:ro
entrypoint: /opt/keycloak/bin/kc.sh start-dev --import-realm
ports:
- "8181:8080"
healthcheck:
# HTTP/1.0 + Connection: close so `head -n 1` doesn't wait for chunked
# keep-alive frames. The image is bash-based, so /dev/tcp is available;
# curl is not.
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8080 && printf 'GET /realms/thesis-management HTTP/1.0\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && head -n 1 <&3 | grep -q '200 OK'"]
interval: 5s
timeout: 5s
retries: 30
mailpit:
image: axllent/mailpit:v1.34.0
container_name: thesis-management-showcase-mailpit
ports:
- "1125:1025"
- "8125:8025"
server:
image: ghcr.io/ls1intum/thesis-management/thesis-management-server:latest
container_name: thesis-management-showcase-server
depends_on:
db:
condition: service_healthy
keycloak:
condition: service_healthy
mailpit:
condition: service_started
environment:
# `dev` activates application-dev.yml, which switches Liquibase to the
# `dev` context and runs the seed migration (test users, topics, theses,
# applications). See the "Automatic Dev Seed Data" section of
# documentation/docs/developer/development-setup.mdx.
SPRING_PROFILES_ACTIVE: dev
# application-dev.yml also hardcodes server.port=8180, which collides
# with the published image's expected port 8080. Override back to 8080
# so the container listens on the port the host mapping targets.
SERVER_PORT: "8080"
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/thesis-management
SPRING_DATASOURCE_USERNAME: thesis-management-postgres
SPRING_DATASOURCE_PASSWORD: thesis-management-postgres
# In-container URL for Admin API calls (AccessManagementService).
KEYCLOAK_HOST: http://keycloak:8080
KEYCLOAK_REALM_NAME: thesis-management
KEYCLOAK_SERVICE_CLIENT_ID: thesis-management-service-client
# The realm JSON imports the service client with secret "**********",
# which is also the default in application.yml. Kept here for clarity.
KEYCLOAK_SERVICE_CLIENT_SECRET: "**********"
# Override the JWT validation URIs so they use the same issuer the
# web app sees (KC_HOSTNAME above), not the in-container keycloak:8080.
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: http://localhost:8181/realms/thesis-management
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: http://keycloak:8080/realms/thesis-management/protocol/openid-connect/certs
CLIENT_HOST: http://localhost:3100
MAIL_ENABLED: "true"
MAIL_SENDER: showcase@thesis-management.local
# Spring env-var overrides win over application-dev.yml's localhost:1125,
# which would not resolve inside the container.
SPRING_MAIL_HOST: mailpit
SPRING_MAIL_PORT: "1025"
volumes:
- showcase_uploads:/uploads
- showcase_data_exports:/data-exports
ports:
- "8180:8080"
client:
image: ghcr.io/ls1intum/thesis-management/thesis-management-client:latest
container_name: thesis-management-showcase-client
depends_on:
server:
condition: service_started
environment:
# The values below are read by client/public/generate-runtime-env.js
# at container start and written into /usr/share/nginx/html/runtime-env.js.
SERVER_HOST: http://localhost:8180
KEYCLOAK_HOST: http://localhost:8181
KEYCLOAK_REALM_NAME: thesis-management
KEYCLOAK_CLIENT_ID: thesis-management-app
CHAIR_NAME: Thesis Management Showcase
# Renders a marker banner. parseEnvironment in client/src/config/global.ts
# only accepts production / staging / test / dev — `dev` is the closest
# match for a seeded demo deployment.
ENVIRONMENT: dev
# The showcase server runs the `dev` profile, which enables the AI feedback
# module (application-dev.yml → thesis-management.ai.enabled=true). Mirror it
# here so the client actually renders the AI buttons the server serves.
AI_FEATURES_ENABLED: "true"
ports:
- "3100:80"
volumes:
showcase_db_data:
showcase_uploads:
showcase_data_exports: