Skip to content

Commit 2d8f002

Browse files
committed
added docker file
1 parent 7b1f8e9 commit 2d8f002

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use Node.js official image
2+
FROM node:18-alpine
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Copy package.json and install dependencies
8+
COPY package*.json ./
9+
RUN npm install
10+
11+
# Copy the rest of the app
12+
COPY . .
13+
14+
# Build the React app
15+
RUN npm run build
16+
17+
# Use Nginx to serve the build
18+
FROM nginx:alpine
19+
COPY --from=0 /app/build /usr/share/nginx/html
20+
21+
EXPOSE 80
22+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)