forked from webkom/lego-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (40 loc) · 1.22 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
FROM node:14-alpine as builder
WORKDIR /app/
COPY . /app
RUN yarn --ignore-scripts
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:14-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/package.json .
COPY --from=builder /app/node_modules node_modules
ENTRYPOINT ["node", "dist/server.js"]