# 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;"]