generated from ytgov/vue-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
57 lines (39 loc) · 1.78 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM node:18.17.0-alpine3.17
# See https://pptr.dev/chromium-support for supported chrome to puppeteer version.
RUN apk add --no-cache \
chromium=112.0.5615.165-r0
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
#RUN apk --no-cache add msttcorefonts-installer fontconfig && \
# update-ms-fonts && \
# fc-cache -f
COPY fonts/*.ttf /usr/share/fonts/
RUN fc-cache -fv
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/
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/
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm run build:docker
EXPOSE 3000
WORKDIR /home/node/app
ENV NODE_ENV=production
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ARG IMAGE_TAG=0.0.0
ENV IMAGE_TAG=$IMAGE_TAG
RUN npm run build
COPY --chown=node:node src/api/templates/* /home/node/app/dist/templates/
COPY --chown=node:node src/api/templates/admin/* /home/node/app/dist/templates/admin/
COPY --chown=node:node src/api/templates/admin/vendor/* /home/node/app/dist/templates/admin/vendor/
COPY --chown=node:node src/api/templates/email/* /home/node/app/dist/templates/email/
COPY --chown=node:node src/api/templates/layouts/* /home/node/app/dist/templates/layouts/
COPY --chown=node:node src/api/web/*.png /home/node/app/dist/web/
CMD [ "node", "./dist/index.js" ]