-
-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1010 Bytes
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 1010 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
36
37
38
39
40
41
# syntax = docker/dockerfile:1.4
ARG NODE_VERSION=22.17.0
FROM node:${NODE_VERSION}-slim AS base
LABEL fly_launch_runtime="Node.js"
WORKDIR /app
ENV NODE_ENV=production
ARG PNPM_VERSION=10.18.0
RUN npm install -g pnpm@$PNPM_VERSION
# --- Build stage ---
FROM base AS build
# System deps only if you have native modules; otherwise you can drop this
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 && \
rm -rf /var/lib/apt/lists/*
# Install deps
COPY .npmrc package.json ./
RUN pnpm install --prod=false
# Copy the application (including the previously downloaded artifact under docs/)
COPY . .
# IMPORTANT: we no longer generate docs here; they were provided by CI
# Build the app (should read from docs/generated-docs/* and versions.ts that CI uploaded)
RUN pnpm run build
# Prune dev deps
RUN pnpm prune --prod
# --- Runtime stage ---
FROM base
COPY --from=build /app /app
EXPOSE 3000
CMD ["pnpm","run","start"]