ADD: Dockerize

This commit is contained in:
sebastian 2026-08-03 14:14:20 +02:00
parent b6c0c50968
commit 9b58aaaa0b
3 changed files with 23 additions and 1 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# Stage 1: Build
FROM node:26-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build -- --configuration production
# Stage 2: Serve
FROM nginx:alpine
COPY --from=build /app/dist/WetterHub/browser /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

9
nginx.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}

View File

@ -7,7 +7,7 @@ import {Configuration} from './api';
export function apiConfigFactory() {
return new Configuration({
basePath: 'http://localhost:8000'
basePath: `${window.location.protocol}//${window.location.hostname}:8000`
});
}