From 05fd626cb488217cb7dcba2a68d7f90864163f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teresa=20Gonz=C3=A1lez?= <144899619+uo288347@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:54:10 +0100 Subject: [PATCH] Update Dockerfile --- webapp/Dockerfile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 935f0785..48650066 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -1,21 +1,18 @@ FROM node:20 +COPY . /app WORKDIR /app -# Copiar solo el archivo package.json -COPY package.json . - -# Install dependencies +#Install the dependencies RUN npm install -# Copiar el resto del código -COPY . . +ARG API_URI="http://localhost:8000" +ENV REACT_APP_API_ENDPOINT=$API_URI -# Build the app +#Create an optimized version of the webapp RUN npm run build - -# Instalar serve RUN npm install serve -#CMD ["serve", "-s", "build"] - +#Execute npm run prod to run the server +CMD [ "npm", "run", "prod" ] +#CMD ["npm", "start"]