forked from kausaltech/kausal-watch-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (34 loc) · 1.08 KB
/
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
41
42
43
44
45
46
47
48
#syntax=docker/dockerfile:1.2
FROM node:20-alpine as base
RUN mkdir -p /app
WORKDIR /app
# Python is required for node-gyp, which will be built with `yarn install`
RUN apk --no-cache add g++ make python3 git
RUN corepack enable
ARG YARN_NPM_REGISTRY_SERVER
ARG YARN_NPM_AUTH_IDENT
ENV YARN_NPM_ALWAYS_AUTH=${YARN_NPM_AUTH_IDENT:+true}
ENV YARN_NPM_ALWAYS_AUTH=${YARN_NPM_ALWAYS_AUTH:-false}
# Install dependencies first
ENV YARN_CACHE_FOLDER /yarn-cache
COPY yarn.lock package*.json ./
COPY patches ./patches/
RUN yarn config set nodeLinker 'node-modules'
RUN yarn config set logFilters --json '[{"code": "YN0013", "level": "discard"}]'
RUN --mount=type=cache,target=/yarn-cache yarn install --immutable
COPY . .
FROM base as bundle
# For Sentry source map upload
ARG SENTRY_PROJECT
ARG SENTRY_URL
ARG SENTRY_ORG
ARG SENTRY_AUTH_TOKEN
ARG GIT_REPO
ARG GIT_REV
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
yarn build
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
docker/sentry-set-release-commits.sh
COPY ./docker/entrypoint.sh /entrypoint.sh
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]