From 2195b968becd598fb9371f84c3eaa2e1ca84ee0a Mon Sep 17 00:00:00 2001 From: Enoma Victor Osasenaga Date: Mon, 6 May 2024 14:24:43 +0100 Subject: [PATCH] Docker configuration setup Initial docker setup Fix docker build error Add changes Fix requested changes Delete compose file --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5909f0f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/engine/reference/builder/#dockerignore-file + + +**/.dockerignore +**/.gitignore +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +LICENSE +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..566c203 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use the official Node.js image as the base image +FROM node:21-bullseye + +# Set the working directory inside the container +WORKDIR /app + +# Copy the entire project +COPY . . + +# Set the yarn version to be that defined as packageManager +RUN yarn set version 4.1.1 + +# Install the dependencies +RUN yarn install --immutable + +# Build the Vite app with the base path +RUN yarn run build + +# Expose the port on which the app will run +EXPOSE 5173 + +# Start the app with dist directory +CMD ["yarn", "preview", "--host", "--port", "5173"]