dockerifle n stuff

This commit is contained in:
christian 2024-04-26 17:30:48 +02:00
parent 1b46acc6b9
commit 252548aff8
2 changed files with 24 additions and 8 deletions

View File

@ -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 WORKDIR /app
COPY package.json ./ # Copy all local files into the image
COPY package-lock.json ./ COPY . .
RUN npm install
COPY . ./ # Clean install all node modules
RUN npm ci
# Build SvelteKit app
RUN npm run build RUN npm run build
FROM nginx:1.19-alpine # Delete source code files that were used to build the app that are no longer needed
COPY --from=build . 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"]

View File

@ -109,7 +109,7 @@
<li>Portfolio web page</li> <li>Portfolio web page</li>
<p class="pl-4"> <p class="pl-4">
This is my portfolio page, which will soon be available at rannes.dev. I'm using 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. currently not exposed to the internet as I am still building it.
</p> </p>
<li>Crowdsec Security Engine</li> <li>Crowdsec Security Engine</li>