Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jifollan authored and GitHub Enterprise committed Mar 3, 2025
1 parent 8ded3d2 commit 7375887
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]

0 comments on commit 7375887

Please sign in to comment.