Skip to content

Commit 5a2cfe2

Browse files
authored
Merge pull request #169 from DefangLabs/unify-dockerfile
unified dockerfiles
2 parents cd410e4 + 98bca78 commit 5a2cfe2

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

client/Dockerfile

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
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
38
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
414
COPY package*.json ./
15+
16+
# Install any needed packages specified in package.json
517
RUN npm install
18+
19+
# Copy the current directory contents into the container at /app
620
COPY . .
21+
22+
# Build the React application
723
RUN npm run build
24+
25+
# Expose port 3000
826
EXPOSE 3000
9-
CMD ["npx", "serve", "-s", "build"]
27+
28+
# Command to serve the built React app
29+
CMD ["npx", "serve", "-s", "build"]

0 commit comments

Comments
 (0)