Dockerify
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@
|
|||||||
# Useful .gitignore templates: https://github.com/github/gitignore
|
# Useful .gitignore templates: https://github.com/github/gitignore
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
.cache
|
.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