-
Notifications
You must be signed in to change notification settings - Fork 59
/
Dockerfile
40 lines (30 loc) · 981 Bytes
/
Dockerfile
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
40
# syntax=docker/dockerfile:experimental
FROM node:21.6.0 as builder
LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole
ARG TARGETARCH
ENV npm_config_target_arch "${TARGETARCH}"
ENV npm_config_target_platform linux
ENV npm_config_target_libc glibc
WORKDIR /my-project/
COPY . /my-project/
# install production dependencies
RUN : \
--mount=type=cache,target=/root/.yarn \
&& yarn workspaces focus --production --all
# build console web app
RUN : \
--mount=type=cache,target=/root/.yarn \
&& BASE_URL=/console yarn workspace @clients/console run build:prod
# copy console build to /app
RUN : \
--mount=type=cache,target=/root/.yarn \
&& mkdir /app \
&& cp -R ./website/console/dist/* /app
FROM gcr.io/distroless/nodejs
LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole
COPY --from=builder /app app
WORKDIR /app
ENV NODE_ENV=production BASE_URL=/console PORT=8080
EXPOSE 8080
USER 1000
CMD ["server.js"]