-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (31 loc) · 860 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
# Stage 1: Build Stage
FROM node:18-alpine as builder
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY tsconfig.json tsconfig.build.json .env ./
COPY src/ src/
RUN yarn build
RUN rm -rf node_modules \
&& yarn install --production --frozen-lockfile
# Stage 2: Run Stage
FROM node:18-alpine
WORKDIR /usr/src/app
RUN apk add --no-cache \
dumb-init \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
weasyprint
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/package.json ./package.json
COPY --from=builder /usr/src/app/.env ./
COPY --from=builder /usr/src/app/dist/ ./
ENV NODE_ENV production
ENV APP_ENV production
EXPOSE 3333
# ENTRYPOINT ["dumb-init", "node", "infra/http/app.js"]
CMD ["sh"]