forked from flyteorg/flyteconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (26 loc) · 862 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
# syntax=docker/dockerfile:experimental
# Use node:17 to docker build on M1
FROM --platform=${BUILDPLATFORM} node:16 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/
RUN : \
--mount=type=cache,target=/root/.yarn \
# install production dependencies
&& yarn workspaces focus --all --production \
&& yarn build:types \
&& BASE_URL=/console yarn run build:prod \
&& mkdir /app \
&& cp -R ./website/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 PORT=8080
EXPOSE 8080
USER 1000
CMD ["server.js"]