File size: 608 Bytes
9383bfc
 
ae4e258
9383bfc
 
ae4e258
9383bfc
 
ae4e258
9383bfc
 
ae4e258
9383bfc
 
ae4e258
9383bfc
 
ae4e258
9383bfc
 
 
 
 
 
 
 
ae4e258
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Use node image as a base for building frontend
FROM node:14 AS frontend

# Set the working directory for the frontend in the container
WORKDIR /app/frontend

# Copy frontend source code
COPY frontend /app/frontend

# Install frontend dependencies
RUN npm install

# Build the frontend for production
RUN npm run build

# Use nginx image to serve the built frontend
FROM nginx:alpine AS production

# Copy the built frontend from the previous stage to nginx
COPY --from=frontend /app/frontend/build /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start nginx server
CMD ["nginx", "-g", "daemon off;"]