-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile
59 lines (43 loc) · 1.39 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
49
50
51
52
53
54
55
56
57
58
59
FROM node:18-alpine as builder
WORKDIR /app/
COPY . /app
RUN apk add curl
RUN yarn
ENV NODE_ENV production
RUN yarn build
FROM getsentry/sentry-cli:1.26.1 as sentry
WORKDIR /app/
ARG SENTRY_AUTH_TOKEN
ARG SENTRY_ORG
ARG SENTRY_PROJECT
ARG SENTRY_URL
ARG RELEASE
ARG COMMIT_SHA
ENV SENTRY_AUTH_TOKEN ${SENTRY_AUTH_TOKEN}
ENV SENTRY_ORG ${SENTRY_ORG}
ENV SENTRY_PROJECT ${SENTRY_PROJECT}
ENV SENTRY_URL ${SENTRY_URL}
ENV RELEASE ${RELEASE}
COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client
RUN sentry-cli releases new ${RELEASE}
RUN sentry-cli releases set-commits ${RELEASE} --commit "webkom/lego-webapp@${COMMIT_SHA}"
RUN sentry-cli releases \
files ${RELEASE} upload-sourcemaps \
--rewrite --url-prefix="/app/dist/" \
'./dist/'
RUN sentry-cli releases finalize ${RELEASE}
RUN sentry-cli releases deploys ${RELEASE} new -e "staging"
RUN sentry-cli releases deploys ${RELEASE} new -e "production"
FROM node:18-alpine
RUN apk add curl
WORKDIR /app/
ARG RELEASE
ENV RELEASE ${RELEASE}
COPY --from=builder /app/dist dist
COPY --from=builder /app/dist-client dist-client
COPY --from=builder /app/packages/lego-bricks/dist packages/lego-bricks/dist
COPY --from=builder /app/packages/lego-bricks/package.json packages/lego-bricks/package.json
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules node_modules
ENTRYPOINT ["node", "dist/server.js"]