24 lines
534 B
Docker
24 lines
534 B
Docker
# -- Build stage --
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
|
|
# Alleen package-bestanden eerst (better caching)
|
|
COPY package*.json ./
|
|
RUN npm ci || npm install
|
|
|
|
# Dan de rest van de code
|
|
COPY . .
|
|
|
|
# LET OP: pas dit aan als jouw build-script anders heet
|
|
RUN npm run build
|
|
|
|
# -- Serve stage --
|
|
FROM nginx:alpine
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
# Pas dit aan als jouw outputmap niet 'dist' is (bijv. 'build')
|
|
COPY --from=build /app/dist ./
|
|
|
|
# Optioneel: eigen nginx.conf voor SPA routing
|
|
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|