Skip to content

Commit 979405d

Browse files
authored
Update Dockerfile
1 parent c88c3f5 commit 979405d

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

Dockerfile

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
# Stage 1: Build the Astro static site
2-
FROM node:18-alpine AS builder
3-
4-
# Set working directory
5-
WORKDIR /app
6-
7-
# Install dependencies
8-
COPY package.json package-lock.json ./
9-
RUN npm install --production
10-
11-
# Copy source files and build Astro
12-
COPY . .
13-
RUN npm run build
14-
15-
# Stage 2: Serve the static files with NGINX
1+
# Use NGINX to serve static files
162
FROM nginx:alpine
173

18-
# Copy the Astro build output to NGINX's HTML directory
19-
COPY --from=builder /app/dist /usr/share/nginx/html
4+
# Copy pre-built static files from the GitHub Actions build step
5+
COPY dist/ /usr/share/nginx/html
206

217
# Expose the HTTP port
228
EXPOSE 80

0 commit comments

Comments
 (0)