-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (19 loc) · 788 Bytes
/
Dockerfile
File metadata and controls
26 lines (19 loc) · 788 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
# syntax=docker/dockerfile:1.7
FROM node:20-alpine AS builder
WORKDIR /app
# Enable pnpm via Corepack
RUN corepack enable
# Install workspace dependencies with pnpm using a two-phase copy to leverage Docker layer caching
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/site/package.json apps/site/
RUN pnpm install --frozen-lockfile
# Copy the rest of the repository and build the Astro site
COPY . .
RUN pnpm --filter site build
FROM nginx:1.27-alpine AS runner
LABEL org.opencontainers.image.source="https://github.com/theschoonover/webpage"
# Copy hardened nginx configuration and static assets
COPY infra/nginx/site.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/site/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]