File tree 1 file changed +23
-3
lines changed
1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 1
- FROM node:20-alpine
2
- WORKDIR /app
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:20-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
3
8
ARG REACT_APP_API_URL=http://localhost:3010
9
+
10
+ # Set the working directory to /app
11
+ WORKDIR /app
12
+
13
+ # Copy package.json and package-lock.json into the container at /app
4
14
COPY package*.json ./
15
+
16
+ # Install any needed packages specified in package.json
5
17
RUN npm install
18
+
19
+ # Copy the current directory contents into the container at /app
6
20
COPY . .
21
+
22
+ # Build the React application
7
23
RUN npm run build
24
+
25
+ # Expose port 3000
8
26
EXPOSE 3000
9
- CMD ["npx" , "serve" , "-s" , "build" ]
27
+
28
+ # Command to serve the built React app
29
+ CMD ["npx" , "serve" , "-s" , "build" ]
You can’t perform that action at this time.
0 commit comments