-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (26 loc) · 1.02 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (26 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
# Define versions as build arguments for easy updates
ARG PNPM_VERSION=12.4.2
FROM node:26.8.2-trixie-slim@sha256:f7bb8247fdb16250dbec7fd0e24f091c6f5f0a29d256f3aef5816a7a369166b2
ARG PNPM_VERSION
RUN npm install -g pnpm@${PNPM_VERSION}
WORKDIR /app
ENV DOCKER=true
# Copy only files that affect dependency fetching.
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches/ patches/
# Populate pnpm's package store with production and development dependencies.
RUN pnpm fetch
# Copy source code and all workspace package.json files.
COPY . .
# Construct node_modules from the populated store.
RUN pnpm install --offline --frozen-lockfile --strict-peer-dependencies --prod=false
# Make entrypoint executable (in case the host bit was lost)
RUN chmod +x /app/docker-entrypoint.sh
# Frequently changing build metadata goes after dependency installation.
ARG GIT_BRANCH
ARG GIT_COMMIT_SHA
ENV NODE_ENV=production
ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
EXPOSE 3000
ENTRYPOINT ["/app/docker-entrypoint.sh"]