-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (37 loc) · 1006 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
FROM node:22 AS build
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
WORKDIR /usr/src/app
COPY package*.json ./
COPY yarn.lock ./
RUN yarn install
COPY . .
RUN yarn build
FROM node:22-alpine as productionModules
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
WORKDIR /usr/src/app
COPY package*.json ./
COPY yarn.lock ./
RUN yarn install --production=true
FROM node:22-alpine as release
ARG NODE_ENV=production
ENV NODE_ENV=$NODE_ENV
ARG SOFTWARE_VERSION
ENV SOFTWARE_VERSION=$SOFTWARE_VERSION
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
WORKDIR /usr/src/app
EXPOSE 3000
COPY print-frontend ./print-frontend
COPY --from=productionModules /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/dist ./dist
RUN set -x \
&& apk update \
&& apk upgrade \
&& apk add --no-cache \
udev \
ttf-freefont \
icu-data-full \
chromium
CMD ["node", "dist/main"]