-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
43 lines (32 loc) · 939 Bytes
/
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
FROM node:18-alpine AS base
WORKDIR /app
## Install dependencies ##
FROM base AS install
COPY package.json pnpm-lock.yaml ./
COPY prisma ./prisma/
RUN corepack enable pnpm && pnpm install --frozen-lockfile
RUN pnpm prisma generate
## Build bundle ##
FROM install AS builder
COPY --from=install /app/node_modules node_modules
COPY . .
ARG API_SUPERKEY
ARG DATABASE_URL
ARG JWT_HMAC_KEY
ARG PUBLIC_VATSIM_OAUTH_CLIENT_ID
ARG PUBLIC_VATSIM_OAUTH_ENDPOINT
ARG PUBLIC_VATSIM_OAUTH_REDIRECT_URI
ARG VATSIM_CORE_API_TOKEN
ARG VATSIM_OAUTH_CLIENT_SECRET
ARG SENTRY_AUTH_TOKEN
ENV NODE_ENV=production
RUN corepack enable pnpm && pnpm run build
RUN pnpm prisma migrate deploy
## Production image ##
FROM base AS app
COPY --from=install /app/node_modules node_modules
COPY --from=install /app/package.json package.json
COPY --from=builder /app/build ./build
EXPOSE 3000/tcp
CMD bun ./build/index.js
ENTRYPOINT [ "node", "build/index.js" ]