-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathDockerfile.dev
More file actions
34 lines (28 loc) · 1.1 KB
/
Dockerfile.dev
File metadata and controls
34 lines (28 loc) · 1.1 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
FROM node:24-alpine3.23
RUN adduser -D rafiki
WORKDIR /home/rafiki
# Install Corepack and pnpm as the Rafiki user
USER rafiki
RUN mkdir -p /home/rafiki/.local/bin
ENV PATH="/home/rafiki/.local/bin:$PATH"
RUN corepack enable --install-directory ~/.local/bin
RUN corepack prepare [email protected] --activate
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./
# Fetch the pnpm dependencies, but use a local cache.
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm fetch \
| grep -v "cross-device link not permitted\|Falling back to copying packages from store"
# Copy the source code and chown the relevant folders back to the Rafiki user
USER root
COPY . ./
RUN chown -v -R rafiki:rafiki /home/rafiki/localenv
RUN chown -v -R rafiki:rafiki /home/rafiki/packages
RUN chown -v -R rafiki:rafiki /home/rafiki/test
# As the Rafiki user, install the rest of the dependencies and build the source code
USER rafiki
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install \
--recursive \
--offline \
--frozen-lockfile
CMD pnpm --filter card-service dev