forked from signalwire/docs-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 1.02 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
FROM node:20 AS builder
WORKDIR /app
# Set memory limit for Node.js operations
ENV NODE_OPTIONS="--max-old-space-size=4096"
# Copy root package files first for better caching
COPY package*.json ./
COPY .yarnrc* ./
COPY tsconfig.json ./
# Copy workspace package.json files for dependency resolution
COPY website/package*.json ./website/
COPY specs/package*.json ./specs/
COPY tools/package*.json ./tools/
# Copy source code (needed for postinstall build)
COPY website ./website
COPY specs ./specs
COPY tools ./tools
# Install dependencies and run postinstall (builds specs)
RUN yarn install --frozen-lockfile
# Build the website
RUN yarn build:website
# Switch to website directory for final output
WORKDIR /app/website
# Production stage
FROM nginx
COPY --from=builder /app/website/provisioning/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/website/provisioning/nginx/redirects.map /etc/nginx/redirects.map
COPY --from=builder /app/website/build/ /usr/share/nginx/html
# Test nginx configuration
RUN nginx -t
EXPOSE 80