generated from code-forge-io/base-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 747 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 747 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
# syntax = docker/dockerfile:1.4
ARG NODE_VERSION=22
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 ---
# We consume the docs generated by the CI
FROM base AS build
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/*
COPY .npmrc package.json pnpm-lock.yaml ./
RUN pnpm install --prod=false --frozen-lockfile
COPY . .
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"]