labmap/frontend/Dockerfile
dvirlabs 341cd0388f
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Trigger frontend build to test TLS fix
2026-03-25 01:33:49 +02:00

32 lines
728 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;"]