npm
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -1,18 +1,23 @@
|
|||||||
# Build stage
|
# -- Build stage --
|
||||||
FROM node:20-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files
|
# Alleen package-bestanden eerst (better caching)
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci || npm install
|
||||||
|
|
||||||
|
# Dan de rest van de code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# LET OP: pas dit aan als jouw build-script anders heet
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Runtime stage
|
# -- Serve stage --
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
|
||||||
COPY --from=build /app/dist/ /usr/share/nginx/html/
|
# Pas dit aan als jouw outputmap niet 'dist' is (bijv. 'build')
|
||||||
|
COPY --from=build /app/dist ./
|
||||||
|
|
||||||
EXPOSE 80
|
# Optioneel: eigen nginx.conf voor SPA routing
|
||||||
|
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
"name": "viewer",
|
"name": "viewer",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user