From 7375887aed1254436e6ce7e5701b9bfafbe7801a Mon Sep 17 00:00:00 2001 From: Jonathan Inge Arvesen Folland Date: Mon, 3 Mar 2025 19:24:35 +0100 Subject: [PATCH] Update Dockerfile --- frontend/Dockerfile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 07bb35f..159a1b3 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,15 +1,8 @@ # Use a base Node image FROM node:latest -# Enable bash and install dos2unix -RUN if [ -f /etc/alpine-release ]; then \ - apk add --no-cache bash dos2unix; \ - else \ - apt-get update && apt-get install -y bash dos2unix; \ - fi - -# Install react essentials -RUN npm install react-scripts@4.0.3 -g && npm install -g serve +# Install bash and dos2unix (for Windows compatibility) +RUN apt-get update && apt-get install -y bash dos2unix # Set the working directory inside the container WORKDIR /src @@ -21,8 +14,11 @@ RUN npm install # Copy the rest of the source code COPY . . -# Convert entrypoint script to unix format if PC is running windows +# Convert entrypoint script to Unix format if PC is running Windows RUN dos2unix entrypoint.sh -# Start app +# Install react-scripts and serve as needed +RUN npm install react-scripts@4.0.3 -g && npm install -g serve + +# Start the app CMD ["/bin/bash", "entrypoint.sh"]