-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 777 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 777 Bytes
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
FROM node:lts-slim AS build
ENV ADAPTER_NODE=true
ARG SENTRY_ORG
ENV SENTRY_ORG=$SENTRY_ORG
ARG SENTRY_PROJECT
ENV SENTRY_PROJECT=$SENTRY_PROJECT
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
RUN apt-get update; apt-get full-upgrade -y; apt-get install -y openjdk-17-jre-headless git
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . ./
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN || echo $SENTRY_AUTH_TOKEN) npm run build
RUN npm ci --omit=dev
FROM node:lts-slim AS run
RUN apt-get update; apt-get full-upgrade -y; apt-get install -y git
WORKDIR /app
COPY --from=build /app /app
RUN git fetch --unshallow || echo "Nothing to do"
EXPOSE 3000
USER nobody
CMD ["npm", "start"]