-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
59 lines (40 loc) · 2.1 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
# syntax=docker/dockerfile:1.10-labs
FROM node:23 AS build
ENV NODE_ENV="production"
ADD --link --exclude=packages/mobile . /builddir
WORKDIR /builddir
RUN corepack yarn install
WORKDIR /builddir/packages/common
RUN corepack yarn run build
WORKDIR /builddir/packages/portal
RUN corepack yarn run build
WORKDIR /builddir/packages/server
RUN corepack yarn prisma generate
RUN corepack yarn build
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN,required \
corepack yarn sentry-cli sourcemaps inject --org ukdanceblue --project server ./dist && \
corepack yarn sentry-cli sourcemaps upload --org ukdanceblue --project server ./dist
# Server
FROM node:23 AS server
ENV MS_OIDC_URL="https://login.microsoftonline.com/2b30530b-69b6-4457-b818-481cb53d42ae/v2.0/.well-known/openid-configuration"
ENV APPLICATION_PORT="8000"
RUN mkdir -p /app/packages/portal
RUN mkdir -p /app/packages/server
RUN mkdir -p /app/packages/common
RUN mkdir -p /app/.yarn
RUN mkdir -p /app/node_modules
COPY --from=build /builddir/packages/server/dist /app/packages/server/dist
COPY --from=build /builddir/packages/server/prisma /app/packages/server/prisma
COPY --from=build /builddir/packages/server/package.json /app/packages/server/package.json
COPY --from=build --chmod=777 /builddir/packages/server/docker-entrypoint.sh /app/packages/server/docker-entrypoint.sh
COPY --from=build /builddir/packages/portal/dist /app/packages/portal/dist
COPY --from=build /builddir/packages/portal/package.json /app/packages/portal/package.json
COPY --from=build /builddir/packages/common/dist /app/packages/common/dist
COPY --from=build /builddir/packages/common/package.json /app/packages/common/package.json
COPY --from=build /builddir/node_modules /app/node_modules
COPY --from=build /builddir/package.json /app/package.json
COPY --from=build /builddir/yarn.lock /app/yarn.lock
WORKDIR /app/packages/server
ENTRYPOINT ["/app/packages/server/docker-entrypoint.sh"]
CMD [ "node", "." ]
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD bash -c '[[ "$(curl -fs http://localhost:8000/api/healthcheck)" == "OK" ]] || exit 1'