FROM node:22-alpine AS build WORKDIR /app COPY package*.json ./ RUN npm install COPY . . ARG PUBLIC_URL=/nachsuche/ ENV PUBLIC_URL=$PUBLIC_URL ARG REACT_APP_API_URL= ENV REACT_APP_API_URL=$REACT_APP_API_URL # Limit Node.js heap during build to prevent OOM kills ENV NODE_OPTIONS="--max_old_space_size=512" RUN npm run build FROM nginx:alpine RUN apk add --no-cache wget # Copy custom nginx configuration (cache headers, gzip, security headers) COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy built app COPY --from=build /app/build /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]