forked from salman0ansari/whatsapp-api-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
43 lines (30 loc) · 755 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
43
FROM node:19-alpine as base
WORKDIR /build
COPY package.json package-lock.json ./
RUN npm install
COPY ./ .
RUN npm run build
# ------------------------------------------------------------------------
FROM node:19-alpine
USER root
RUN apk add --no-cache --no-progress tini
USER node
ARG DIR=/home/node/app
ENV DIR $DIR
WORKDIR $DIR
COPY --from=base "/build/lib" .
COPY --from=base "/build/node_modules" "./node_modules"
RUN mkdir -p "$DIR/fs"
USER root
RUN chown node:node $DIR
USER node
ARG PORT=3333
ENV PORT $PORT
ENV PROTECT_ROUTES false
ENV RESTORE_SESSIONS_ON_START_UP true
ENV DATABASE_ENABLED true
ENV DATABASE_KIND localfs
ENV LOCALFS_PATH $DIR/fs
EXPOSE $PORT
VOLUME ["$DIR/fs"]
ENTRYPOINT ["/sbin/tini", "--", "node", "server.js"]