forked from code-chat-br/whatsapp-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
108 lines (81 loc) · 2.82 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
### BASE IMAGE
FROM node:20-bullseye-slim AS base
RUN apt update -y
RUN apt upgrade -y
RUN apt install -y git
RUN npm install -g npm
### BUILD IMAGE
FROM base AS builder
WORKDIR /codechat
COPY ./package.json .
RUN npm install
COPY ./tsconfig.json .
COPY ./src ./src
COPY ./public ./public
RUN npm run build
### RELEASE IMAGE
FROM base AS release
WORKDIR /codechat
COPY --from=builder /codechat/package*.json .
RUN npm ci --omit=dev
LABEL version="1.2.8" description="Api to control whatsapp features through http requests."
LABEL maintainer="Cleber Wilson" git="https://github.com/jrCleber"
LABEL contact="[email protected]" whatsapp="https://chat.whatsapp.com/HyO8X8K0bAo0bfaeW8bhY5" telegram="https://t.me/codechatBR"
COPY --from=builder /codechat/dist .
COPY ./tsconfig.json .
COPY ./src ./src
COPY ./public ./public
RUN mkdir instances
ENV DOCKER_ENV=true
ENV CORS_ORIGIN='*'
ENV CORS_METHODS='POST,GET,PUT,DELETE'
ENV CORS_CREDENTIALS=true
ENV LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK'
ENV LOG_COLOR=true
ENV DEL_INSTANCE=5
ENV STORE_CLEANING_INTERVAL=7200
ENV STORE_MESSAGE=true
ENV STORE_CONTACTS=false
ENV STORE_CHATS=false
ENV DATABASE_ENABLED=false
ENV DATABASE_CONNECTION_URI='mongodb://<USER>:<PASSWORD>@<HOST>/?authSource=admin&readPreference=primary&ssl=false&directConnection=true'
ENV DATABASE_CONNECTION_DB_PREFIX_NAME='codechat'
ENV DATABASE_SAVE_DATA_INSTANCE=false
ENV DATABASE_SAVE_DATA_OLD_MESSAGE=false
ENV DATABASE_SAVE_DATA_NEW_MESSAGE=true
ENV DATABASE_SAVE_MESSAGE_UPDATE=true
ENV DATABASE_SAVE_DATA_CONTACTS=true
ENV DATABASE_SAVE_DATA_CHATS=true
ENV REDIS_ENABLED=false
ENV REDIS_URI='redis://<HOST>/1'
ENV REDIS_PREFIX_KEY='codechat'
ENV WEBHOOK_GLOBAL_URL='<url>'
ENV WEBHOOK_GLOBAL_ENABLED=false
ENV WEBHOOK_EVENTS_STATUS_INSTANCE=true
ENV WEBHOOK_EVENTS_QRCODE_UPDATED=true
ENV WEBHOOK_EVENTS_MESSAGES_SET=true
ENV WEBHOOK_EVENTS_MESSAGES_UPDATE=true
ENV WEBHOOK_EVENTS_MESSAGES_UPSERT=true
ENV WEBHOOK_EVENTS_SEND_MESSAGE=true
ENV WEBHOOK_EVENTS_CONTACTS_SET=true
ENV WEBHOOK_EVENTS_CONTACTS_UPSERT=true
ENV WEBHOOK_EVENTS_CONTACTS_UPDATE=true
ENV WEBHOOK_EVENTS_PRESENCE_UPDATE=true
ENV WEBHOOK_EVENTS_CHATS_SET=true
ENV WEBHOOK_EVENTS_CHATS_UPSERT=true
ENV WEBHOOK_EVENTS_CHATS_UPDATE=true
ENV WEBHOOK_EVENTS_CONNECTION_UPDATE=true
ENV WEBHOOK_EVENTS_GROUPS_UPSERT=false
ENV WEBHOOK_EVENTS_GROUPS_UPDATE=false
ENV WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
ENV WEBHOOK_EVENTS_NEW_JWT_TOKEN=false
ENV CONFIG_SESSION_PHONE_CLIENT='CodeChat'
ENV CONFIG_SESSION_PHONE_NAME='Chrome'
ENV QRCODE_LIMIT=6
ENV AUTHENTICATION_TYPE='jwt'
ENV AUTHENTICATION_API_KEY='t8OOEeISKzpmc3jjcMqBWYSaJsafdefer'
ENV AUTHENTICATION_JWT_EXPIRIN_IN=0
ENV AUTHENTICATION_JWT_SECRET='3RFYiiRmvNiokSBrLZzx'
EXPOSE 8083
# All settings must be in the env.yml file, passed as a volume to the container
CMD [ "node", "./src/main.js" ]