-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathDockerfileEdsDocs
More file actions
42 lines (30 loc) · 1.21 KB
/
DockerfileEdsDocs
File metadata and controls
42 lines (30 loc) · 1.21 KB
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
36
37
38
39
40
41
42
# Use Node.js 22.12 with Alpine - allows patch updates while maintaining reproducibility
FROM docker.io/node:22.12-alpine AS build
LABEL org.opencontainers.image.title="EDS Documentation Site"
LABEL org.opencontainers.image.description="Equinor Design System Documentation Site"
LABEL org.opencontainers.image.source="https://github.com/equinor/design-system"
WORKDIR /app
# Install pnpm globally
RUN npm install -g pnpm@10.15.0
# Copy everything else
COPY . ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Build all necessary dependencies and docs
RUN pnpm run build:token-sync && \
pnpm run build:tokens-build && \
pnpm run build:icons && \
pnpm run build:tokens && \
pnpm run build:utils && \
pnpm run build:core-react && \
pnpm run build:docs
# Use unprivileged nginx image for better security
FROM nginxinc/nginx-unprivileged:stable-alpine
# Copy built documentation site with proper ownership
COPY --chown=101 --from=build /app/apps/design-system-docs/build/ /usr/share/nginx/html/
# Copy nginx configuration
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Use the nginx user (UID 101)
USER 101
EXPOSE 3000
# Default nginx command (nginx-unprivileged runs in foreground by default)