/ Dockerfile
Dockerfile
 1  # Adapted from https://turbo.build/repo/docs/handbook/deploying-with-docker
 2  FROM node:lts-alpine AS base
 3  
 4  # Assemble a pruned version of the repo containing only what's needed for router
 5  FROM base AS builder
 6  RUN apk add --no-cache libc6-compat
 7  RUN apk update
 8  WORKDIR /app
 9  
10  RUN yarn global add turbo
11  COPY . .
12  RUN turbo prune --scope="@fedimint/router" --docker
13  
14  # Install dependencies & build the app
15  FROM base AS installer
16  RUN apk add --no-cache libc6-compat
17  RUN apk update
18  WORKDIR /app
19  
20  COPY --from=builder /app/out/json/ .
21  COPY --from=builder /app/out/yarn.lock ./yarn.lock
22  RUN yarn install
23  COPY --from=builder /app/out/full/ .
24  # TODO: Remove this copy once https://github.com/vercel/turbo/issues/3758 is fixed
25  COPY ./turbo.json .
26  RUN yarn build
27  
28  # Run the built app with a minimal image
29  FROM base AS runner
30  WORKDIR /app
31  
32  # note: remember to make changes to the installPhase in flake.nix as well
33  COPY --from=installer /app/apps/router/build build
34  COPY scripts/replace-react-env.js scripts/replace-react-env.js
35  COPY scripts/write-config-from-env.js scripts/write-config-from-env.js
36  RUN yarn global add serve
37  CMD node scripts/write-config-from-env.js build && serve -s build