From 252548aff8237c445e515a3770bfefcc865a27a5 Mon Sep 17 00:00:00 2001 From: christian Date: Fri, 26 Apr 2024 17:30:48 +0200 Subject: [PATCH] dockerifle n stuff --- Dockerfile | 30 +++++++++++++++++++++++------- src/routes/homelab/+page.svelte | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index fc24076..bcef241 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,28 @@ -FROM node:21 AS build +#Dockerfile +# Use this image as the platform to build the app +FROM node:18-alpine AS external-website + +# A small line inside the image to show who made it +LABEL Developers="Christian Rannes" + +# The WORKDIR instruction sets the working directory for everything that will happen next WORKDIR /app -COPY package.json ./ -COPY package-lock.json ./ -RUN npm install -COPY . ./ +# Copy all local files into the image +COPY . . + +# Clean install all node modules +RUN npm ci + +# Build SvelteKit app RUN npm run build -FROM nginx:1.19-alpine -COPY --from=build . \ No newline at end of file +# Delete source code files that were used to build the app that are no longer needed +RUN rm -rf src/ static/ emailTemplates/ docker-compose.yml + +# The USER instruction sets the user name to use as the default user for the remainder of the current stage +USER node:node + +# This is the command that will be run inside the image when you tell Docker to start the container +CMD ["node","build/index.js"] \ No newline at end of file diff --git a/src/routes/homelab/+page.svelte b/src/routes/homelab/+page.svelte index 9f6ba6d..9c7c11e 100644 --- a/src/routes/homelab/+page.svelte +++ b/src/routes/homelab/+page.svelte @@ -109,7 +109,7 @@
  • Portfolio web page
  • This is my portfolio page, which will soon be available at rannes.dev. I'm using - svelte/sveltekit and the docker image is built with nginx to serve the page. It is + svelte/sveltekit. It is currently not exposed to the internet as I am still building it.

  • Crowdsec Security Engine