Mirror of https://github.com/roostorg/coop
github.com/roostorg/coop
1FROM node:24.14.1-bullseye-slim AS builder
2
3WORKDIR /app
4
5COPY package*.json .
6
7# Install dependencies
8RUN --mount=type=cache,target=/root/.npm npm ci
9
10COPY . .
11
12RUN npm run build
13
14RUN npm prune --omit=dev
15
16FROM node:24.14.1-bullseye-slim AS base
17
18WORKDIR /app
19
20COPY --from=builder /app/build ./
21COPY --from=builder /app/node_modules ./node_modules
22
23# I create a separate stage for these steps because they are not needed for
24# development and chown can take a long time to run
25FROM base
26
27RUN groupadd -r coop && useradd -r -g coop -u 1001 coop
28
29RUN chown -R coop:coop /app
30
31# kubernetes requires us to use a numeric id for the user
32USER 1001