-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (26 loc) · 932 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
FROM node:18-alpine3.17
RUN apk add --no-cache tzdata
RUN cp /usr/share/zoneinfo/America/Whitehorse /etc/localtime
RUN echo "America/Whitehorse" > /etc/timezone
RUN apk del tzdata
RUN mkdir /home/node/web && chown -R node:node /home/node/web
WORKDIR /home/node/web
COPY --chown=node:node src/web/package*.json ./
RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/web ./
RUN mkdir /home/node/app && chown -R node:node /home/node/app
RUN mkdir /home/node/app/db && chown -R node:node /home/node/app/db
WORKDIR /home/node/app
COPY --chown=node:node src/api/package*.json ./
ENV NODE_ENV=development
USER node
RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/api ./
RUN npm run build
WORKDIR /home/node/web
ENV NODE_ENV=production
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
RUN npm run build
WORKDIR /home/node/app
EXPOSE 3000
CMD ["node", "./dist/index.js"]