-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
33 lines (28 loc) · 810 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
FROM node:lts-bookworm-slim AS base
WORKDIR /app
RUN apt update
RUN apt install -y curl wget fontconfig
RUN rm -rf /var/lib/apt/lists/*
# Base installer
FROM base AS installer
RUN corepack enable
COPY . .
# All deps stage
FROM installer AS deps
RUN yarn workspaces focus @rlanz/site
# Production only deps stage
FROM installer AS production-deps
RUN yarn workspaces focus @rlanz/site --production
# Build stage
FROM installer AS build
COPY --from=deps /app/node_modules /app/node_modules
WORKDIR /app/apps/romainlanz.com
RUN node ace build --ignore-ts-errors
# Production stage
FROM base
ENV NODE_ENV=production
ENV FONTCONFIG_PATH=/etc/fonts
COPY --from=production-deps /app/node_modules /app/node_modules
COPY --from=build /app/apps/romainlanz.com/build /app
EXPOSE 8080
CMD ["node", "./bin/server.js"]