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"]