new build structure

This commit is contained in:
2026-04-10 18:03:56 -05:00
parent be855415d5
commit 74c2c37835
3 changed files with 48 additions and 10 deletions

24
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# frontend/Dockerfile
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Wir setzen die API-URL auf den relativen Pfad, da Frontend und Backend
# jetzt unter der gleichen Domain laufen werden!
ENV VITE_API_URL=""
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
# Standard Nginx-Config für Single Page Applications (React/Vite)
RUN echo 'server { \
listen 80; \
location / { \
root /usr/share/nginx/html; \
index index.html; \
try_files $uri $uri/ /index.html; \
} \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]