-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile.gateway-ui
39 lines (31 loc) · 1.15 KB
/
Dockerfile.gateway-ui
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
# Adapted from https://turbo.build/repo/docs/handbook/deploying-with-docker
FROM node:lts-alpine as base
# Assemble a pruned version of the repo containing only what's needed for gateway-ui
FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope="@fedimint/gateway-ui" --docker
# Install dependencies & build the app
FROM base AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install
COPY --from=builder /app/out/full/ .
# TODO: Remove this copy once https://github.com/vercel/turbo/issues/3758 is fixed
COPY ./turbo.json .
RUN REACT_APP_FM_GATEWAY_API="{{REACT_APP_FM_GATEWAY_API}}" \
REACT_APP_FM_GATEWAY_PASSWORD="{{REACT_APP_FM_GATEWAY_PASSWORD}}" \
yarn build:gateway-ui
# Run the built app with a minimal image
FROM base AS runner
WORKDIR /app
COPY --from=installer /app/apps/gateway-ui/build build
COPY scripts/replace-react-env.js scripts/replace-react-env.js
RUN yarn global add serve
CMD node scripts/replace-react-env.js build && serve -s build