From 8ec4279af5d68e80a7b5c8dca148adea39611d12 Mon Sep 17 00:00:00 2001 From: michael1986 Date: Mon, 1 Dec 2025 12:08:52 +0100 Subject: [PATCH] Dockerify --- .gitignore | 3 ++- Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 427305a..84bbd0b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ # Useful .gitignore templates: https://github.com/github/gitignore node_modules dist -.cache \ No newline at end of file +.cache +.idea/ diff --git a/Dockerfile b/Dockerfile index e69de29..08391e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,23 @@ +# -- 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