Skip to content

Commit d1a1677

Browse files
authored
Merge fc1fea3a6c4661254c378c4478dd9986542c2b70 into 7fdd53b5bfec2da2ad912b62d53ac38f9d95a774
2 parents 8c680a2 + 6cda3a3 commit d1a1677

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

client/Dockerfile

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1-
FROM node:20-alpine
2-
WORKDIR /app
1+
# Use the slim version of Debian Bookworm as the base image
2+
FROM debian:bookworm-slim
3+
4+
# Set environment variables to avoid interactive prompts during package installation
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Argument for API URL
38
ARG REACT_APP_API_URL=http://localhost:3010
9+
10+
# Update the package list and install Node.js, npm, and any other dependencies
11+
RUN apt-get update && apt-get install -y \
12+
curl \
13+
&& curl -sL https://deb.nodesource.com/setup_20.x | bash - \
14+
&& apt-get install -y nodejs \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Set the working directory to /app
19+
WORKDIR /app
20+
21+
# Copy package.json and package-lock.json into the container at /app
422
COPY package*.json ./
23+
24+
# Install any needed packages specified in package.json
525
RUN npm install
26+
27+
# Copy the current directory contents into the container at /app
628
COPY . .
29+
30+
# Build the React application
731
RUN npm run build
32+
33+
# Expose port 3000
834
EXPOSE 3000
9-
CMD ["npx", "serve", "-s", "build"]
35+
36+
# Command to serve the built React app
37+
CMD ["npx", "serve", "-s", "build"]

0 commit comments

Comments
 (0)