-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 728 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 728 Bytes
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
29
30
31
32
33
34
35
# Use Node.js image as the base image for building React app
FROM node:alpine as builder
# Metadata
LABEL name="CDOPS - Blog app"
LABEL author="Tamilvanan Gowran"
LABEL email="hello@tamilvanan.live"
LABEL website="https://gtamilvanan17.github.io/cdops-blogs"
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build React app
RUN npm run build
# Use Nginx as the base image for serving the built Astro app
FROM nginx:alpine
# Copy built app from the previous stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]