FROM nginx:alpine AS builder # Install dos2unix to convert Windows line endings RUN apk add --no-cache dos2unix # Copy built app COPY --from=builder /app/dist /usr/share/nginx/html # Copy nginx config COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy entrypoint + env template COPY public/env.js.template /usr/share/nginx/html/env.js.template COPY docker-entrypoint.sh /entrypoint.sh # Fix line endings RUN dos2unix /entrypoint.sh RUN chmod +x /entrypoint.sh EXPOSE 80 ENTRYPOINT ["/entrypoint.sh"]