-
Notifications
You must be signed in to change notification settings - Fork 113
/
Dockerfile
36 lines (25 loc) · 963 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
FROM node:22.12.0-alpine AS base
RUN apk add --no-cache libc6-compat && \
corepack enable
FROM base as deps
WORKDIR /usr/src/app
COPY package.json yarn.lock .yarnrc.yml ./
COPY prisma/schema.prisma ./prisma/schema.prisma
RUN yarn install --frozen-lockfile
FROM base as builder
WORKDIR /usr/src/app
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY . .
ARG YTF_GRAPHQL_SCHEMA_ENDPOINT
RUN yarn prisma generate && yarn graphql-codegen && yarn run tsc
FROM base
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/prisma ./prisma
COPY --from=builder /usr/src/app/package.json ./package.json
COPY --from=builder /usr/src/app/yarn.lock ./yarn.lock
COPY --from=builder /usr/src/app/.yarnrc.yml ./.yarnrc.yml
COPY --from=builder /usr/src/app/build ./build
COPY /deployment/docker-entrypoint.sh ./docker-entrypoint.sh
ENV NODE_ENV=production
ENTRYPOINT ["./docker-entrypoint.sh"]