-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (36 loc) · 984 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
44
45
46
47
48
49
50
FROM public.ecr.aws/docker/library/node:20 AS build
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV PNPM_HOME=/pnpm
ENV PATH=$PNPM_HOME:$PATH
RUN corepack enable && corepack prepare pnpm@9 --activate
COPY pnpm-lock.yaml .
COPY patches/ patches
RUN pnpm fetch
COPY . .
RUN pnpm install --frozen-lockfile --offline
ARG APP
ARG TURBO_TEAM
ARG TURBO_TOKEN
ENV TURBO_TEAM=${TURBO_TEAM}
ENV TURBO_TOKEN=${TURBO_TOKEN}
ENV NODE_ENV=production
RUN cd apps/${APP} && pnpm turbo build
RUN pnpm deploy --filter=@withglyph/${APP} --prod out
# ---
FROM public.ecr.aws/docker/library/node:20-slim AS runner
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libvips \
tini \
&& rm -rf /var/lib/apt/lists/*
ARG APP
ENV NODE_ENV=production
COPY --from=build --chown=1000 /app/out/ .
USER 1000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["node", "dist/index.js"]