From f1a68e941b8f4a5a5763189176fa1243cc3a9cce Mon Sep 17 00:00:00 2001 From: SevLG Date: Fri, 22 Dec 2023 15:14:11 +0100 Subject: [PATCH] Trying another setup for Dockerfile, because the build broke with the old one --- Dockerfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d192fde..961eb26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ -FROM node:21-alpine - -WORKDIR /react-app/ - -COPY /react-app/ /react-app/ - +FROM node:21-alpine AS development +ENV NODE_ENV development +# Add a work directory +WORKDIR /app +# Cache and Install dependencies +COPY ./react-app/package.json . +COPY ./react-app/package-lock.json . RUN npm install - -CMD ["npm", "start"] \ No newline at end of file +# Copy app files +COPY ./react-app/ . +# Expose port +EXPOSE 3000 +# Start the app +CMD [ "npm", "start" ] \ No newline at end of file