labmap/frontend/Dockerfile
dvirlabs eb46950c86
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Build and push backend
2026-03-25 13:34:39 +02:00

31 lines
727 B
Docker

# Frontend Dockerfile
# Stage 1: Build the frontend
FROM node:20 AS builder
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
# Stage 2: Serve with nginx
FROM nginx:alpine
# Install dos2unix
RUN apk add --no-cache dos2unix
# Copy built app
COPY --from=builder /app/dist /usr/share/nginx/html
# ✅ Copy env.js.template
COPY public/env.js.template /etc/env/env.js.template
# ✅ Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# ✅ Add env generator script to nginx entrypoint hook
COPY 10-generate-env.sh /docker-entrypoint.d/10-generate-env.sh
RUN dos2unix /docker-entrypoint.d/10-generate-env.sh && chmod +x /docker-entrypoint.d/10-generate-env.sh
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]