Dockerify
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.cache
|
||||
.idea/
|
||||
|
||||
23
Dockerfile
23
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
|
||||
|
||||
Reference in New Issue
Block a user