We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b476128 commit 986ca08Copy full SHA for 986ca08
1 file changed
Dockerfile
@@ -0,0 +1,27 @@
1
+# Stage 1: Build React app
2
+FROM node:18 AS build
3
+
4
+WORKDIR /app
5
6
+COPY package*.json ./
7
+RUN npm install
8
9
+COPY . .
10
+RUN npm run build
11
12
+# Stage 2: Serve with Nginx
13
+FROM nginx:alpine
14
15
+# Remove default static assets
16
+RUN rm -rf /usr/share/nginx/html/*
17
18
+# Copy built files from previous stage
19
+COPY --from=build /app/dist /usr/share/nginx/html
20
21
+# Optional: Custom Nginx config
22
+COPY nginx.conf /etc/nginx/conf.d/default.conf
23
24
+EXPOSE 80
25
26
+CMD ["nginx", "-g", "daemon off;"]
27
0 commit comments