File tree Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Expand file tree Collapse file tree 1 file changed +31
-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 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
3
8
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
4
22
COPY package*.json ./
23
+
24
+ # Install any needed packages specified in package.json
5
25
RUN npm install
26
+
27
+ # Copy the current directory contents into the container at /app
6
28
COPY . .
29
+
30
+ # Build the React application
7
31
RUN npm run build
32
+
33
+ # Expose port 3000
8
34
EXPOSE 3000
9
- CMD ["npx" , "serve" , "-s" , "build" ]
35
+
36
+ # Command to serve the built React app
37
+ CMD ["npx" , "serve" , "-s" , "build" ]
You can’t perform that action at this time.
0 commit comments