forked from ytgov/yhsi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (30 loc) · 1.06 KB
/
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:16-alpine3.15
RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN mkdir /home/node/app && chown -R node:node /home/node/app
RUN mkdir /home/node/web && chown -R node:node /home/node/web
COPY --chown=node:node src/web/package*.json /home/node/web/
COPY --chown=node:node src/api/package*.json /home/node/app/
RUN npm install -g npm@8.5.5
USER node
WORKDIR /home/node/app
RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/api/.env* ./
WORKDIR /home/node/web
RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/api /home/node/app/
COPY --chown=node:node src/web /home/node/web/
RUN npm run build:docker
EXPOSE 3000
WORKDIR /home/node/app
ENV NODE_ENV=production
#RUN npm install --platform=linux --arch=x64 sharp@0.29.1
RUN npm run build
CMD [ "node", "./dist/index.js" ]