-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 1.11 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
# Define versions as build arguments for easy updates
ARG NODE_VERSION=24.14.0
ARG PNPM_VERSION=10.33.2
ARG ALPINE_VERSION=3.23
ARG PNPM_URL="https://github.com/pnpm/pnpm/releases/download/v${PNPM_VERSION}/pnpm-linuxstatic-x64"
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION}
ARG PNPM_URL
ARG GIT_BRANCH
ARG GIT_COMMIT_SHA
WORKDIR /app
ENV DOCKER=true
ENV NODE_ENV=production
ENV GIT_BRANCH=${GIT_BRANCH}
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
# Install pnpm (static binary)
RUN wget -qO /bin/pnpm "${PNPM_URL}" && chmod +x /bin/pnpm
# Copy dependency manifests first (for caching)
COPY package.json .
COPY pnpm-lock.yaml .
COPY pnpm-workspace.yaml .
COPY patches/ patches/
# Install all deps (incl. dev) — needed because the build runs at container start.
# --prod=false forces dev deps even though NODE_ENV=production is set above.
RUN pnpm install --frozen-lockfile --strict-peer-dependencies --prod=false
# Copy full source after dependencies are cached
COPY . .
# Make entrypoint executable (in case the host bit was lost)
RUN chmod +x /app/docker-entrypoint.sh
EXPOSE 3000
ENTRYPOINT ["/app/docker-entrypoint.sh"]