Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
34 lines (29 loc) · 1.64 KB
/
Copy pathDockerfile.dev
File metadata and controls
34 lines (29 loc) · 1.64 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
# Shared dev image — has the workspace deps baked in (pnpm install at build
# time), so the dev compose can mount only source/dist dirs without clobbering
# node_modules. Mirrors lava-connect's Dockerfile.dev.
# pnpm comes from its official image, pinned by digest. Its version matches
# `packageManager` in package.json; Dependabot moves this line, so move the
# pin with it.
FROM ghcr.io/pnpm/pnpm:12.21.0-alpine@sha256:0251e9865e906e94d68a1267b4b4bc10e07f6350b850b4532404ee65dc1bfbb8 AS pnpm
FROM node:26.13.1-alpine@sha256:6bd9ab43c0ec0190ca7b2d193906cb8b7edf6e7f4afa43ddeccd6452710bffb5
# pnpm's native binary and the node-gyp it uses for native builds. A pnpm
# that is not the one `packageManager` pins fails the build rather than
# downloading the pinned one.
COPY --from=pnpm /opt/pnpm /opt/pnpm
RUN for bin in pnpm pn pnpx pnx; do ln -s "/opt/pnpm/$bin" "/usr/local/bin/$bin"; done
ENV pnpm_config_pm_on_fail=error
WORKDIR /app
# Install deps against the lockfile so the image carries node_modules for all
# workspace packages. Source is mounted at runtime by docker-compose.dev.yml.
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json tsconfig.base.json ./
COPY packages/shared/package.json packages/shared/
COPY packages/db/package.json packages/db/
COPY apps/api/package.json apps/api/
COPY apps/web/package.json apps/web/
RUN pnpm install --frozen-lockfile
# Build shared + db once so api/web have a dist to resolve before the watcher warms.
COPY packages/shared/ packages/shared/
COPY packages/db/ packages/db/
RUN pnpm --filter @sr/shared build && pnpm --filter @sr/db build
# Default command is overridden per-service in docker-compose.dev.yml.
CMD ["sh"]