-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.server
40 lines (36 loc) · 1.36 KB
/
Dockerfile.server
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
#syntax=docker/dockerfile:1
FROM node:20-bookworm-slim AS base
RUN apt-get update -y && apt-get install -y ca-certificates git openssl
FROM base AS build
WORKDIR /app
COPY ./.yarn/ .yarn/
COPY .yarnrc.yml .yarnrc.yml
COPY desktop desktop/
COPY server server/
COPY jobrunner jobrunner/
COPY utility utility/
COPY package.json package.json
COPY yarn.lock yarn.lock
RUN --mount=type=cache,id=badger-yarn,target=.yarn/cache yarn workspaces focus badger-server badger-jobrunner
# NB: Please keep everything above this line the same in all the Dockerfiles, to properly leverage the Docker cache
ENV NODE_ENV=production
ARG SERVER_SENTRY_DSN
ENV SERVER_SENTRY_DSN=$SERVER_SENTRY_DSN
ARG IS_YSTV_BUILD
ENV IS_YSTV_BUILD=$IS_YSTV_BUILD
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
ARG GIT_REV
ENV GIT_REV=$GIT_REV
RUN yarn workspace badger-server run build
FROM base
COPY --from=build /app/server/.next/standalone /app
COPY --from=build /app/server/public /app/server/public
COPY --from=build /app/server/.next/static /app/server/.next/static
# Copy these in so that we can still run Prisma migrations in prod
COPY --from=build /app/utility/prisma/schema.prisma /app/utility/prisma/schema.prisma
COPY --from=build /app/utility/prisma/migrations /app/utility/prisma/migrations
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME="0.0.0.0"
ENTRYPOINT ["node", "server/server.js"]