Skip to content

Commit c973730

Browse files
committed
fix: Create .env for installation in docker
1 parent 048bea3 commit c973730

3 files changed

Lines changed: 90 additions & 78 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Adjust in store files
1313
* Fixed the problem when do not save contacts when receive messages
1414
* Changed owner of the jid for instanceName
15+
* Create .env for installation in docker
1516

1617
# 1.1.3 (2023-07-06 11:43)
1718

Docker/.env

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
CORS_ORIGIN='*' # Or separate by commas - ex.: 'yourdomain1.com, yourdomain2.com'
2+
CORS_METHODS='POST,GET,PUT,DELETE'
3+
CORS_CREDENTIALS=true
4+
5+
# Determine the logs to be displayed
6+
LOG_LEVEL='ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS'
7+
LOG_COLOR=true
8+
LOG_BAILEYS=error
9+
10+
# Determine how long the instance should be deleted from memory in case of no connection.
11+
# Default time: 5 minutes
12+
# If you don't even want an expiration, enter the value false
13+
DEL_INSTANCE=false
14+
15+
# Temporary data storage
16+
STORE_MESSAGES=true
17+
STORE_MESSAGE_UP=true
18+
STORE_CONTACTS=true
19+
STORE_CHATS=true
20+
CLEAN_STORE_CLEANING_INTERVAL=7200 # seconds === 2h
21+
CLEAN_STORE_MESSAGES=true
22+
CLEAN_STORE_MESSAGE_UP=true
23+
CLEAN_STORE_CONTACTS=true
24+
CLEAN_STORE_CHATS=true
25+
26+
# Permanent data storage
27+
DATABASE_ENABLED=false
28+
DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
29+
DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
30+
31+
DATABASE_SAVE_DATA_INSTANCE=true
32+
DATABASE_SAVE_DATA_OLD_MESSAGE=false
33+
DATABASE_SAVE_DATA_NEW_MESSAGE=true
34+
DATABASE_SAVE_MESSAGE_UPDATE=true
35+
DATABASE_SAVE_DATA_CONTACTS=true
36+
DATABASE_SAVE_DATA_CHATS=true
37+
38+
REDIS_ENABLED=false
39+
REDIS_URI=redis://redis:6379/1
40+
REDIS_PREFIX_KEY=evolution
41+
42+
# Webhook Settings
43+
## Define a global webhook that will listen for enabled events from all instances
44+
WEBHOOK_GLOBAL_URL=<url>
45+
WEBHOOK_GLOBAL_ENABLED=false
46+
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
47+
WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
48+
## Set the events you want to hear
49+
WEBHOOK_EVENTS_APPLICATION_STARTUP=false
50+
WEBHOOK_EVENTS_QRCODE_UPDATED=true
51+
WEBHOOK_EVENTS_MESSAGES_SET=true
52+
WEBHOOK_EVENTS_MESSAGES_UPSERT=true
53+
WEBHOOK_EVENTS_MESSAGES_UPDATE=true
54+
WEBHOOK_EVENTS_CONTACTS_SET=true
55+
WEBHOOK_EVENTS_CONTACTS_UPSERT=true
56+
WEBHOOK_EVENTS_CONTACTS_UPDATE=true
57+
WEBHOOK_EVENTS_PRESENCE_UPDATE=true
58+
WEBHOOK_EVENTS_CHATS_SET=true
59+
WEBHOOK_EVENTS_CHATS_UPSERT=true
60+
WEBHOOK_EVENTS_CHATS_UPDATE=true
61+
WEBHOOK_EVENTS_CHATS_DELETE=true
62+
WEBHOOK_EVENTS_GROUPS_UPSERT=true
63+
WEBHOOK_EVENTS_GROUPS_UPDATE=true
64+
WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
65+
WEBHOOK_EVENTS_CONNECTION_UPDATE=true
66+
# This event fires every time a new token is requested via the refresh route
67+
WEBHOOK_EVENTS_NEW_JWT_TOKEN=true
68+
69+
CONFIG_SESSION_PHONE_CLIENT=Evolution API
70+
CONFIG_SESSION_PHONE_NAME=chrome # chrome | firefox | edge | opera | safari
71+
72+
# Set qrcode display limit
73+
QRCODE_LIMIT=30
74+
75+
# Defines an authentication type for the api
76+
AUTHENTICATION_TYPE='apikey' # jwt or 'apikey'
77+
## Define a global apikey to access all instances.
78+
### OBS: This key must be inserted in the request header to create an instance.
79+
AUTHENTICATION_API_KEY='B6D711FCDE4D4FD5936544120E713976'
80+
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
81+
## Set the secret key to encrypt and decrypt your token and its expiration time
82+
AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s ===1h | zero (0) - never expires
83+
AUTHENTICATION_JWT_SECRET='L0YWtjb2w554WFqPG'
84+
85+
AUTHENTICATION_INSTANCE_MODE=server
86+
AUTHENTICATION_INSTANCE_NAME=evolution
87+
AUTHENTICATION_INSTANCE_WEBHOOK_URL=<url>

docker-compose.yaml

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -13,84 +13,8 @@ services:
1313
volumes:
1414
- evolution_instances:/evolution/instances
1515
- evolution_store:/evolution/store
16-
environment:
17-
- LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS
18-
- LOG_BAILEYS=error
19-
# Determine how long the instance should be deleted from memory in case of no connection.
20-
# Default time: 5 minutes
21-
# If you don't even want an expiration, enter the value false
22-
- DEL_INSTANCE=false # 5 or false
23-
# Temporary data storage
24-
- STORE_MESSAGES=true
25-
- STORE_MESSAGE_UP=true
26-
- STORE_CONTACTS=true
27-
- STORE_CHATS=true
28-
- CLEAN_STORE_CLEANING_INTERVAL=7200 # seconds === 2h
29-
- CLEAN_STORE_MESSAGES=true
30-
- CLEAN_STORE_MESSAGE_UP=true
31-
- CLEAN_STORE_CONTACTS=true
32-
- CLEAN_STORE_CHATS=true
33-
# Permanent data storage
34-
- DATABASE_ENABLED=false
35-
- DATABASE_CONNECTION_URI=mongodb://root:root@mongodb:27017/?authSource=admin&readPreference=primary&ssl=false&directConnection=true
36-
- DATABASE_CONNECTION_DB_PREFIX_NAME=evolution
37-
# Choose the data you want to save in the application's database or store
38-
- DATABASE_SAVE_DATA_INSTANCE=true
39-
- DATABASE_SAVE_DATA_OLD_MESSAGE=false
40-
- DATABASE_SAVE_DATA_NEW_MESSAGE=true
41-
- DATABASE_SAVE_MESSAGE_UPDATE=true
42-
- DATABASE_SAVE_DATA_CONTACTS=true
43-
- DATABASE_SAVE_DATA_CHATS=true
44-
- REDIS_ENABLED=true
45-
- REDIS_URI=redis://redis:6379/1
46-
- REDIS_PREFIX_KEY=evolution
47-
# Webhook Settings
48-
# Define a global webhook that will listen for enabled events from all instances
49-
- WEBHOOK_GLOBAL_URL=<url>
50-
- WEBHOOK_GLOBAL_ENABLED=false
51-
# With this option activated, you work with a url per webhook event, respecting the global url and the name of each event
52-
- WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
53-
# Automatically maps webhook paths
54-
# Set the events you want to hear
55-
- WEBHOOK_EVENTS_APPLICATION_STARTUP=false
56-
- WEBHOOK_EVENTS_QRCODE_UPDATED=true
57-
- WEBHOOK_EVENTS_MESSAGES_SET=true
58-
- WEBHOOK_EVENTS_MESSAGES_UPSERT=true
59-
- WEBHOOK_EVENTS_MESSAGES_UPDATE=true
60-
- WEBHOOK_EVENTS_CONTACTS_SET=true
61-
- WEBHOOK_EVENTS_CONTACTS_UPSERT=true
62-
- WEBHOOK_EVENTS_CONTACTS_UPDATE=true
63-
- WEBHOOK_EVENTS_PRESENCE_UPDATE=true
64-
- WEBHOOK_EVENTS_CHATS_SET=true
65-
- WEBHOOK_EVENTS_CHATS_UPSERT=true
66-
- WEBHOOK_EVENTS_CHATS_UPDATE=true
67-
- WEBHOOK_EVENTS_CHATS_DELETE=true
68-
- WEBHOOK_EVENTS_GROUPS_UPSERT=true
69-
- WEBHOOK_EVENTS_GROUPS_UPDATE=true
70-
- WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
71-
- WEBHOOK_EVENTS_CONNECTION_UPDATE=true
72-
# This event fires every time a new token is requested via the refresh route
73-
- WEBHOOK_EVENTS_NEW_JWT_TOKEN=true
74-
# Name that will be displayed on smartphone connection
75-
- CONFIG_SESSION_PHONE_CLIENT=Evolution API
76-
- CONFIG_SESSION_PHONE_NAME=chrome # chrome | firefox | edge | opera | safari
77-
# Set qrcode display limit
78-
- QRCODE_LIMIT=30
79-
# Defines an authentication type for the api
80-
- AUTHENTICATION_TYPE=apikey # jwt or apikey
81-
# Define a global apikey to access all instances
82-
# OBS: This key must be inserted in the request header to create an instance.
83-
- AUTHENTICATION_API_KEY=B6D711FCDE4D4FD5936544120E713976
84-
# Expose the api key on return from fetch instances
85-
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
86-
# Set the secret key to encrypt and decrypt your token and its expiration time.
87-
- AUTHENTICATION_JWT_EXPIRIN_IN=0 # seconds - 3600s === 1h | zero (0) - never expires
88-
# Set the instance name and webhook url to create an instance in init the application
89-
# With this option activated, you work with a url per webhook event, respecting the local url and the name of each event
90-
- AUTHENTICATION_INSTANCE_MODE=server # container or server
91-
# if you are using container mode, set the container name and the webhook url to default instance
92-
- AUTHENTICATION_INSTANCE_NAME=evolution
93-
- AUTHENTICATION_INSTANCE_WEBHOOK_URL=<url>
16+
env_file:
17+
- ./Docker/.env
9418
command: ['node', './dist/src/main.js']
9519
networks:
9620
- evolution-net

0 commit comments

Comments
 (0)