From cc2f17e0a5314e1cd3f062ba71205317968b2927 Mon Sep 17 00:00:00 2001 From: ludelanier Date: Wed, 8 May 2024 04:51:20 +0200 Subject: [PATCH] images --- Dockerfile | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index fdc77c5..1ae50b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,9 @@ -FROM node:16 +FROM node:lts-alpine as builder -# Set the working directory in the container WORKDIR /app +COPY . ./ +RUN npm install && npm vite build -# Copy package.json and package-lock.json to the working directory -COPY package*.json ./ +FROM nginx:alpine -# Install app dependencies -RUN npm install - -# Copy the rest of your application code to the working directory -COPY . . - -# Expose a port to communicate with the React app -EXPOSE 80 - -# Start your React app -CMD ["npm", "run", "dev"] \ No newline at end of file +COPY --from=builder /app/dist /usr/share/nginx/html \ No newline at end of file