Add root docker-compose and webapp Dockerfile/nginx for full-stack deployment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christoph K.
2026-04-05 20:29:17 +02:00
parent 07fdd3de31
commit 4b730b1076
3 changed files with 86 additions and 0 deletions

11
webapp/Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

28
webapp/nginx.conf Normal file
View File

@@ -0,0 +1,28 @@
server {
listen 80;
# API und Auth-Endpunkte zum Backend proxieren
location /v1/ {
proxy_pass http://api:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /login {
proxy_pass http://api:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /logout {
proxy_pass http://api:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# SPA: alle anderen Routen auf index.html
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}