navix/frontend/Dockerfile
dvirlabs a1871d505c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Build and push app to harbor
2026-03-22 10:13:55 +02:00

29 lines
723 B
Docker

# Stage 1: Build the frontend
FROM node:20 AS builder
WORKDIR /app
COPY . .
RUN npm install --legacy-peer-deps
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;"]