├── .gitignore ├── LICENSE.md ├── README.md ├── docker-server-chatwoot ├── .env ├── docker-compose.yaml ├── wppconnect-chatwoot │ └── data │ │ ├── postgres │ │ └── .gitignore │ │ └── redis │ │ └── .gitignore ├── wppconnect-nginx │ ├── Dockerfile │ └── nginx.conf └── wppconnect-server │ ├── Dockerfile │ └── config.ts ├── docker-server-cli-k8s └── k8s_01 │ ├── deployment.yaml │ ├── pvc.yaml │ └── service.yaml ├── docker-server-front-dev ├── docker-compose.yaml ├── wppconnect-front │ └── Dockerfile ├── wppconnect-nginx │ ├── Dockerfile │ └── nginx.conf └── wppconnect-server │ └── Dockerfile ├── docker-server-front-vue ├── docker-compose.yaml ├── wppconnect-front │ ├── Dockerfile │ └── config.js ├── wppconnect-nginx │ ├── Dockerfile │ └── nginx.conf └── wppconnect-server │ ├── Dockerfile │ └── config.ts ├── docker-server-front ├── docker-compose.yaml ├── wppconnect-front │ ├── Dockerfile │ └── config.js ├── wppconnect-nginx │ ├── Dockerfile │ └── nginx.conf └── wppconnect-server │ ├── Dockerfile │ └── config.ts ├── docker-server-load-balancing-redis ├── docker-compose.yaml ├── wppconnect-nginx │ ├── Dockerfile │ ├── conf.d │ │ ├── access.lua │ │ ├── balance.lua │ │ ├── hosts.lua │ │ └── nginx.conf │ └── nginx.conf └── wppconnect-server │ ├── Dockerfile │ └── config.ts ├── docker-server-load-balancing ├── docker-compose.yaml ├── wppconnect-nginx │ ├── Dockerfile │ ├── conf.d │ │ └── nginx.conf │ └── nginx.conf └── wppconnect-server │ ├── Dockerfile │ └── config.ts ├── docker-server-php-mysql-dev ├── docker-compose.yaml ├── wppconnect-mysql │ ├── db │ │ └── .gitignore │ └── sql │ │ └── db_table.sql ├── wppconnect-nginx │ ├── Dockerfile │ └── nginx.conf ├── wppconnect-php-client │ ├── Dockerfile │ └── app │ │ ├── composer.json │ │ ├── composer.lock │ │ └── html │ │ └── .gitignore └── wppconnect-server │ ├── Dockerfile │ └── config.ts └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .husky 3 | .idea 4 | commitlint.config.js 5 | docker-server-https 6 | docker-server-cli 7 | docker-server-cli-nginx 8 | package-lock.json -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | Copyright 2021 WPPConnect Team 179 | 180 | Licensed under the Apache License, Version 2.0 (the "License"); 181 | you may not use this file except in compliance with the License. 182 | You may obtain a copy of the License at 183 | 184 | http://www.apache.org/licenses/LICENSE-2.0 185 | 186 | Unless required by applicable law or agreed to in writing, software 187 | distributed under the License is distributed on an "AS IS" BASIS, 188 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 189 | See the License for the specific language governing permissions and 190 | limitations under the License. 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WPPConnect Team 2 | ## _Wppconnect Docker_ 3 | 4 | Crie facilmente imagens do Docker com diferentes versões/combinações de linguagens e dependências comuns, para uso no WPPConnect. 5 | 6 | ## Nossos canais online 7 | 8 | [![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet&label=Discord&logo=discord&style=flat)](https://discord.gg/JU5JGGKGNG) 9 | [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect) 10 | [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K) 11 | [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect) 12 | 13 | ## Requisitos 14 | 15 | * Docker [3.x](https://www.docker.com/get-started) ou mais recente. 16 | 17 | ## Instalação 18 | 19 | Faça o download da pasta correspondente ao tutorial abaixo para instalar: 20 | 21 | ### Docker #1: Deploy do Server e Front-end utilizando Contêineres. 22 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=TQJ4ID1vs_c 23 | - Pasta: [docker-server-front](./docker-server-front) 24 | 25 | ### Docker #2: Configurando um ambiente de desenvolvimento para o WPPConnect. 26 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=kDHbf1TWkBw 27 | - Pasta: [docker-server-front-dev](./docker-server-front-dev) 28 | - Utilize os arquivos de configuração do tutorial anterior ([Docker#1](https://www.youtube.com/watch?v=TQJ4ID1vs_c)) e crie pasta "/app" com a versão atual dos repositórios ([wppconnect-server](https://github.com/wppconnect-team/wppconnect-server) e [wppconnect-front](https://github.com/wppconnect-team/wppconnect-frontend)) dentro de suas respectivas aplicações. 29 | 30 | ### Docker #3: Subindo tudo com apenas uma linha de comando utilizando o server-cli 31 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=zBmCnPS3JOQ 32 | 33 | ### Docker #4: Configurando um certificado https para o localhost. 34 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=Mk0sIYJ6peE 35 | 36 | ### Docker #5: Configurando 5 Servers do WPPConnect com load balancing utilizando o Nginx. 37 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=nfc-yDrtnMQ 38 | - Pasta: [docker-server-load-balancing](./docker-server-load-balancing) 39 | 40 | ### Docker #6: Configurando o Server do WPPConnect com Chatwoot utilizando o Nginx. 41 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=00616mTid-M 42 | - Pasta: [docker-server-chatwoot](./docker-server-chatwoot) 43 | 44 | ### Docker #7: Utilizando o Client PHP + MySQL + phpMyAdmin + Nginx com o Server WPPConnect. 45 | - Tutorial no Canal do Youtube: https://www.youtube.com/watch?v=o_TBIyxFbNI 46 | - Pasta: [docker-server-php-mysql-dev](./docker-server-php-mysql-dev) 47 | 48 | ## Roadmap (Próximos Vídeos/Tutoriais) 49 | - Docker #8: Configurando o Client Laravel para consumir os endpoints do WPPConnect. 50 | 51 | ## Comandos Utilizados 52 | 53 | Compila, (re)cria, inicia e anexa um contêiner para um serviço: 54 | ``` bash 55 | $ docker-compose up --build --no-start 56 | ``` 57 | Para e remove todos o(s) contêiner(es) e a(s) rede(s): 58 | ``` bash 59 | $ docker-compose down 60 | ``` 61 | 62 | Inicia o(s) contêiner(es): 63 | ``` bash 64 | $ docker-compose start [nomedoserviço...] 65 | ``` 66 | 67 | Para o(s) contêiner(es): 68 | ``` bash 69 | $ docker-compose stop [nomedoserviço...] 70 | ``` 71 | 72 | Lista as imagens usadas pelos contêineres criados: 73 | ``` bash 74 | $ docker images 75 | ``` 76 | 77 | Visualiza os logs dos contêineres. 78 | ``` bash 79 | $ docker logs [nomedoserviço...] 80 | ``` 81 | 82 | Visualiza as estatística dos contêineres como: consumo de cpu, memória, etc... 83 | ``` bash 84 | $ docker stats [nomedoserviço....] 85 | ``` 86 | 87 | Exclui todos os processos/serviços do computador local: 88 | ``` bash 89 | $ docker rm $(docker ps -a -q) -f 90 | ``` 91 | 92 | Exclui todas as imagens do computador local: 93 | ``` bash 94 | $ docker rmi $(docker images -a -q) -f 95 | ``` 96 | 97 | Remove o cache do builder: 98 | ``` bash 99 | $ docker builder prune 100 | ``` 101 | 102 | Remove as redes não utilizadas: 103 | ``` bash 104 | $ docker network prune 105 | ``` 106 | 107 | Acesse o [link](https://docs.docker.com/reference/) para ver todos os comandos do Docker. 108 | 109 | ## Postman 110 | Acesse o [Postman Collection do WPPConnect](https://documenter.getpostman.com/view/9139457/TzshF4jQ) com todos os endpoints. 111 | -------------------------------------------------------------------------------- /docker-server-chatwoot/.env: -------------------------------------------------------------------------------- 1 | # .env 2 | # Used to verify the integrity of signed cookies. so ensure a secure value is set 3 | SECRET_KEY_BASE=replace_with_lengthy_secure_hex 4 | 5 | # Replace with the URL you are planning to use for your app 6 | FRONTEND_URL=http://localhost:8080 7 | 8 | # If the variable is set, all non-authenticated pages would fallback to the default locale. 9 | # Whenever a new account is created, the default language will be DEFAULT_LOCALE instead of en 10 | DEFAULT_LOCALE=pt_BR 11 | 12 | # If you plan to use CDN for your assets, set Asset CDN Host 13 | ASSET_CDN_HOST= 14 | 15 | # Force all access to the app over SSL, default is set to false 16 | FORCE_SSL=false 17 | 18 | # This lets you control new sign ups on your chatwoot installation 19 | # true : default option, allows sign ups 20 | # false : disables all the end points related to sign ups 21 | # api_only: disables the UI for signup, but you can create sign ups via the account apis 22 | ENABLE_ACCOUNT_SIGNUP=false 23 | 24 | # Redis config 25 | REDIS_URL=redis://redis:6379 26 | # If you are using docker-compose, set this variable's value to be any string, 27 | # which will be the password for the redis service running inside the docker-compose 28 | # to make it secure 29 | REDIS_PASSWORD=chatwoot 30 | # Redis Sentinel can be used by passing list of sentinel host and ports e,g. sentinel_host1:port1,sentinel_host2:port2 31 | REDIS_SENTINELS= 32 | # Redis sentinel master name is required when using sentinel, default value is "mymaster". 33 | # You can find list of master using "SENTINEL masters" command 34 | REDIS_SENTINEL_MASTER_NAME= 35 | 36 | # Postgres Database config variables 37 | POSTGRES_HOST=postgres 38 | POSTGRES_USERNAME=postgres 39 | POSTGRES_PASSWORD=chatwoot 40 | RAILS_ENV=development 41 | RAILS_MAX_THREADS=5 42 | 43 | # The email from which all outgoing emails are sent 44 | # could user either `email@yourdomain.com` or `BrandName ` 45 | MAILER_SENDER_EMAIL=Chatwoot 46 | 47 | 48 | #SMTP domain key is set up for HELO checking 49 | SMTP_DOMAIN=chatwoot.com 50 | # the default value is set "mailhog" and is used by docker-compose for development environments, 51 | # Set the value as "localhost" or your SMTP address in other environments 52 | SMTP_ADDRESS=mailhog 53 | SMTP_PORT=1025 54 | SMTP_USERNAME= 55 | SMTP_PASSWORD= 56 | # plain,login,cram_md5 57 | SMTP_AUTHENTICATION= 58 | SMTP_ENABLE_STARTTLS_AUTO=true 59 | # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html 60 | SMTP_OPENSSL_VERIFY_MODE=peer 61 | 62 | # Mail Incoming 63 | # This is the domain set for the reply emails when conversation continuity is enabled 64 | MAILER_INBOUND_EMAIL_DOMAIN= 65 | # Set this to appropriate ingress channel with regards to incoming emails 66 | # Possible values are : 67 | # relay for Exim, Postfix, Qmail 68 | # mailgun for Mailgun 69 | # mandrill for Mandrill 70 | # postmark for Postmark 71 | # sendgrid for Sendgrid 72 | RAILS_INBOUND_EMAIL_SERVICE= 73 | # Use one of the following based on the email ingress service 74 | # Ref: https://edgeguides.rubyonrails.org/action_mailbox_basics.html 75 | RAILS_INBOUND_EMAIL_PASSWORD= 76 | MAILGUN_INGRESS_SIGNING_KEY= 77 | MANDRILL_INGRESS_API_KEY= 78 | 79 | # Storage 80 | ACTIVE_STORAGE_SERVICE=local 81 | 82 | # Amazon S3 83 | # documentation: https://www.chatwoot.com/docs/configuring-s3-bucket-as-cloud-storage 84 | S3_BUCKET_NAME= 85 | AWS_ACCESS_KEY_ID= 86 | AWS_SECRET_ACCESS_KEY= 87 | AWS_REGION= 88 | 89 | # Sentry 90 | SENTRY_DSN= 91 | 92 | # Log settings 93 | # Disable if you want to write logs to a file 94 | RAILS_LOG_TO_STDOUT=true 95 | LOG_LEVEL=info 96 | LOG_SIZE=500 97 | 98 | ### This environment variables are only required if you are setting up social media channels 99 | 100 | # Facebook 101 | # documentation: https://www.chatwoot.com/docs/facebook-setup 102 | FB_VERIFY_TOKEN= 103 | FB_APP_SECRET= 104 | FB_APP_ID= 105 | 106 | # Twitter 107 | # documentation: https://www.chatwoot.com/docs/twitter-app-setup 108 | TWITTER_APP_ID= 109 | TWITTER_CONSUMER_KEY= 110 | TWITTER_CONSUMER_SECRET= 111 | TWITTER_ENVIRONMENT= 112 | 113 | #slack integration 114 | SLACK_CLIENT_ID= 115 | SLACK_CLIENT_SECRET= 116 | 117 | ### Change this env variable only if you are using a custom build mobile app 118 | ## Mobile app env variables 119 | IOS_APP_ID=6C953F3RX2.com.chatwoot.app 120 | 121 | 122 | ### Smart App Banner 123 | # https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html 124 | # You can find your app-id in https://itunesconnect.apple.com 125 | #IOS_APP_IDENTIFIER=1495796682 126 | 127 | ## Push Notification 128 | ## generate a new key value here : https://d3v.one/vapid-key-generator/ 129 | # VAPID_PUBLIC_KEY= 130 | # VAPID_PRIVATE_KEY= 131 | # 132 | # for mobile apps 133 | # FCM_SERVER_KEY= 134 | 135 | ## Bot Customizations 136 | USE_INBOX_AVATAR_FOR_BOT=true 137 | 138 | 139 | 140 | ## IP look up configuration 141 | ## ref https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md 142 | ## works only on accounts with ip look up feature enabled 143 | # IP_LOOKUP_SERVICE=geoip2 144 | # maxmindb api key to use geoip2 service 145 | # IP_LOOKUP_API_KEY= 146 | 147 | ## Development Only Config 148 | # if you want to use letter_opener for local emails 149 | # LETTER_OPENER=true -------------------------------------------------------------------------------- /docker-server-chatwoot/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | base: &base 5 | image: chatwoot/chatwoot:develop 6 | container_name: chatwoot 7 | hostname: lchatwoot 8 | env_file: .env 9 | stdin_open: true 10 | tty: true 11 | networks: 12 | - wpp-network 13 | rails: 14 | <<: *base 15 | container_name: chatwoot-rails 16 | hostname: chatwoot-rails 17 | depends_on: 18 | - postgres 19 | - redis 20 | environment: 21 | - NODE_ENV=production 22 | - RAILS_ENV=production 23 | networks: 24 | - wpp-network 25 | entrypoint: docker/entrypoints/rails.sh 26 | command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0'] 27 | 28 | sidekiq: 29 | <<: *base 30 | container_name: chatwoot-sidekiq 31 | hostname: chatwoot-sidekiq 32 | depends_on: 33 | - postgres 34 | - redis 35 | environment: 36 | - NODE_ENV=production 37 | - RAILS_ENV=production 38 | networks: 39 | - wpp-network 40 | restart: unless-stopped 41 | command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml'] 42 | 43 | postgres: 44 | image: postgres:latest 45 | container_name: chatwoot-postgres 46 | hostname: chatwoot-postgres 47 | restart: always 48 | volumes: 49 | - ./wppconnect-chatwoot/data/postgres:/var/lib/postgresql/data 50 | environment: 51 | - POSTGRES_DB=chatwoot 52 | - POSTGRES_USER=postgres 53 | - POSTGRES_PASSWORD=chatwoot 54 | networks: 55 | - wpp-network 56 | 57 | pgadmin: 58 | image: dpage/pgadmin4:latest 59 | container_name: chatwoot-pgadmin4 60 | hostname: chatwoot-pgadmin4 61 | environment: 62 | PGADMIN_DEFAULT_EMAIL: "demo@demo.com.br" 63 | PGADMIN_DEFAULT_PASSWORD: "PgAdmin2021!" 64 | depends_on: 65 | - postgres 66 | networks: 67 | - wpp-network 68 | 69 | redis: 70 | image: redis:alpine 71 | container_name: chatwoot-redis 72 | hostname: chatwoot-redis 73 | restart: always 74 | command: ["sh", "-c", "redis-server --requirepass \"$REDIS_PASSWORD\""] 75 | env_file: .env 76 | volumes: 77 | - ./wppconnect-chatwoot/data/redis:/data 78 | networks: 79 | - wpp-network 80 | 81 | wppconnect-server: 82 | build: 83 | context: ./wppconnect-server 84 | dockerfile: Dockerfile 85 | restart: always 86 | image: wppconnect-server 87 | container_name: wppconnect-server 88 | hostname: wppconnect-server 89 | entrypoint: docker-entrypoint.sh yarn start 90 | networks: 91 | - wpp-network 92 | tty: true 93 | 94 | nginx: 95 | build: 96 | context: ./wppconnect-nginx 97 | dockerfile: Dockerfile 98 | container_name: nginx 99 | entrypoint: nginx -g "daemon off;" 100 | ports: 101 | - "8080:8080" #chatwoot 102 | - "8081:8081" #wppconnect 103 | - "8082:8082" #pgadmin 104 | - "8083:8083" #redis 105 | networks: 106 | - wpp-network 107 | depends_on: 108 | - wppconnect-server 109 | 110 | networks: 111 | wpp-network: 112 | name: wpp-network 113 | driver: bridge -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-chatwoot/data/postgres/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wppconnect-team/wpp-docker/b779d7d93e1ad5485dea0f18b48501db5a5687b4/docker-server-chatwoot/wppconnect-chatwoot/data/postgres/.gitignore -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-chatwoot/data/redis/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wppconnect-team/wpp-docker/b779d7d93e1ad5485dea0f18b48501db5a5687b4/docker-server-chatwoot/wppconnect-chatwoot/data/redis/.gitignore -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.25.2-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d 5 | -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8080; 3 | 4 | underscores_in_headers on; 5 | 6 | location / { 7 | 8 | add_header X-Frame-Options "SAMEORIGIN"; 9 | add_header X-XSS-Protection "1; mode=block"; 10 | add_header X-Content-Type-Options "nosniff"; 11 | 12 | charset utf-8; 13 | client_max_body_size 0; 14 | 15 | proxy_http_version 1.1; 16 | proxy_set_header Upgrade $http_upgrade; 17 | proxy_set_header Connection "upgrade"; 18 | proxy_set_header Access-Control-Allow-Origin *; 19 | proxy_set_header Host $http_host; 20 | proxy_set_header X-Real-IP $remote_addr; 21 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 22 | proxy_set_header X-Forwarded-Proto $scheme; 23 | proxy_pass http://rails:3000; 24 | 25 | } 26 | } 27 | 28 | server { 29 | listen 8081; 30 | 31 | underscores_in_headers on; 32 | 33 | location / { 34 | 35 | add_header X-Frame-Options "SAMEORIGIN"; 36 | add_header X-XSS-Protection "1; mode=block"; 37 | add_header X-Content-Type-Options "nosniff"; 38 | 39 | charset utf-8; 40 | 41 | proxy_http_version 1.1; 42 | proxy_set_header Upgrade $http_upgrade; 43 | proxy_set_header Connection $http_connection; 44 | proxy_set_header Access-Control-Allow-Origin *; 45 | proxy_set_header Host $http_host; 46 | proxy_set_header X-Real-IP $remote_addr; 47 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 48 | proxy_set_header X-Forwarded-Proto $scheme; 49 | proxy_pass http://wppconnect-server:21465; 50 | } 51 | } 52 | 53 | server { 54 | listen 8082; 55 | 56 | underscores_in_headers on; 57 | 58 | location / { 59 | 60 | add_header X-Frame-Options "SAMEORIGIN"; 61 | add_header X-XSS-Protection "1; mode=block"; 62 | add_header X-Content-Type-Options "nosniff"; 63 | 64 | charset utf-8; 65 | 66 | proxy_http_version 1.1; 67 | proxy_set_header Upgrade $http_upgrade; 68 | proxy_set_header Connection $http_connection; 69 | proxy_set_header Access-Control-Allow-Origin *; 70 | proxy_set_header Host $http_host; 71 | proxy_set_header X-Real-IP $remote_addr; 72 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 73 | proxy_set_header X-Forwarded-Proto $scheme; 74 | proxy_pass http://pgadmin:80; 75 | } 76 | } 77 | 78 | server { 79 | listen 8083; 80 | 81 | underscores_in_headers on; 82 | 83 | location / { 84 | 85 | add_header X-Frame-Options "SAMEORIGIN"; 86 | add_header X-XSS-Protection "1; mode=block"; 87 | add_header X-Content-Type-Options "nosniff"; 88 | 89 | charset utf-8; 90 | 91 | proxy_http_version 1.1; 92 | proxy_set_header Upgrade $http_upgrade; 93 | proxy_set_header Connection $http_connection; 94 | proxy_set_header Access-Control-Allow-Origin *; 95 | proxy_set_header Host $http_host; 96 | proxy_set_header X-Real-IP $remote_addr; 97 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 98 | proxy_set_header X-Forwarded-Proto $scheme; 99 | proxy_pass http://redis:6379; 100 | } 101 | } 102 | 103 | -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | ENV PORT=21465 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | 13 | COPY ./config.ts /home/node/app/src 14 | 15 | RUN yarn install 16 | RUN yarn build 17 | 18 | FROM node:lts-alpine3.18 19 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 20 | WORKDIR /home/node/app 21 | RUN apk add chromium 22 | COPY --from=builder /home/node/app/ . 23 | EXPOSE 21465 24 | ENTRYPOINT ["node", "dist/server.js"] 25 | -------------------------------------------------------------------------------- /docker-server-chatwoot/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | websocket: { 27 | autoDownload: false, 28 | uploadS3: false, 29 | }, 30 | chatwoot: { 31 | sendQrCode: true, 32 | sendStatus: true, 33 | }, 34 | archive: { 35 | enable: false, 36 | waitTime: 10, 37 | daysToArchive: 45, 38 | }, 39 | log: { 40 | level: 'silly', // Before open a issue, change level to silly and retry a action 41 | logger: ['console', 'file'], 42 | }, 43 | createOptions: { 44 | browserArgs: [ 45 | '--disable-web-security', 46 | '--no-sandbox', 47 | '--disable-web-security', 48 | '--aggressive-cache-discard', 49 | '--disable-cache', 50 | '--disable-application-cache', 51 | '--disable-offline-load-stale-cache', 52 | '--disk-cache-size=0', 53 | '--disable-background-networking', 54 | '--disable-default-apps', 55 | '--disable-extensions', 56 | '--disable-sync', 57 | '--disable-translate', 58 | '--hide-scrollbars', 59 | '--metrics-recording-only', 60 | '--mute-audio', 61 | '--no-first-run', 62 | '--safebrowsing-disable-auto-update', 63 | '--ignore-certificate-errors', 64 | '--ignore-ssl-errors', 65 | '--ignore-certificate-errors-spki-list', 66 | ], 67 | }, 68 | mapper: { 69 | enable: false, 70 | prefix: 'tagone-', 71 | }, 72 | db: { 73 | mongodbDatabase: 'tokens', 74 | mongodbCollection: '', 75 | mongodbUser: '', 76 | mongodbPassword: '', 77 | mongodbHost: '', 78 | mongoIsRemote: true, 79 | mongoURLRemote: '', 80 | mongodbPort: 27017, 81 | redisHost: 'localhost', 82 | redisPort: 6379, 83 | redisPassword: '', 84 | redisDb: 0, 85 | redisPrefix: 'docker', 86 | }, 87 | aws_s3: { 88 | region: 'sa-east-1', 89 | access_key_id: null, 90 | secret_key: null, 91 | defaultBucketName: null, 92 | endpoint: null, 93 | forcePathStyle: null, 94 | }, 95 | }; 96 | -------------------------------------------------------------------------------- /docker-server-cli-k8s/k8s_01/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: server-cli 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: server-cli 10 | template: 11 | metadata: 12 | labels: 13 | app: server-cli 14 | spec: 15 | containers: 16 | - name: server-cli 17 | image: wppconnect/server-cli:latest 18 | command: ["/bin/sh", "-c"] 19 | args: 20 | ["wppserver --secretKey My53cr3tKY --port 21465 --startAllSession"] 21 | volumeMounts: 22 | - mountPath: /home/tokens 23 | name: server-cli-volume 24 | ports: 25 | - containerPort: 21465 26 | 27 | resources: 28 | requests: 29 | cpu: "0.5" 30 | memory: "500Mi" 31 | limits: 32 | cpu: "0.5" 33 | memory: "1Gi" 34 | 35 | startupProbe: 36 | httpGet: 37 | path: /healthz 38 | port: 21465 39 | periodSeconds: 3 40 | failureThreshold: 60 41 | 42 | readinessProbe: 43 | httpGet: 44 | path: /healthz 45 | port: 21465 46 | periodSeconds: 3 47 | failureThreshold: 1 48 | 49 | livenessProbe: 50 | httpGet: 51 | path: /healthz 52 | port: 21465 53 | periodSeconds: 5 54 | failureThreshold: 1 55 | timeoutSeconds: 1 56 | successThreshold: 1 57 | 58 | volumes: 59 | - name: server-cli-volume 60 | persistentVolumeClaim: 61 | claimName: server-cli-volume 62 | -------------------------------------------------------------------------------- /docker-server-cli-k8s/k8s_01/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: server-cli-volume 5 | spec: 6 | resources: 7 | requests: 8 | storage: 1Gi 9 | accessModes: 10 | - ReadWriteOnce 11 | -------------------------------------------------------------------------------- /docker-server-cli-k8s/k8s_01/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: wppconnect 5 | spec: 6 | selector: 7 | app: server-cli 8 | ports: 9 | - port: 8080 10 | targetPort: 21465 11 | type: LoadBalancer 12 | -------------------------------------------------------------------------------- /docker-server-front-dev/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-server: 6 | build: 7 | context: ./wppconnect-server 8 | dockerfile: Dockerfile 9 | restart: always 10 | image: wppconnect-server 11 | container_name: wppconnect-server 12 | hostname: wppconnect-server 13 | volumes: 14 | - ./wppconnect-server/app:/home/node/app 15 | - /home/node/app/node_modules 16 | entrypoint: docker-entrypoint.sh yarn dev 17 | networks: 18 | - wpp-network 19 | tty: true 20 | 21 | wppconnect-front: 22 | build: 23 | context: ./wppconnect-front 24 | dockerfile: Dockerfile 25 | image: wppconnect-front 26 | container_name: wppconnect-front 27 | hostname: wppconnect-front 28 | volumes: 29 | - ./wppconnect-front/app:/home/node/app 30 | - /home/node/app/node_modules 31 | entrypoint: docker-entrypoint.sh yarn start 32 | networks: 33 | - wpp-network 34 | tty: true 35 | depends_on: 36 | - wppconnect-server 37 | 38 | wppconnect-nginx: 39 | build: 40 | context: ./wppconnect-nginx 41 | dockerfile: Dockerfile 42 | container_name: wppconnect-nginx 43 | hostname: wppconnect-nginx 44 | entrypoint: nginx -g "daemon off;" 45 | ports: 46 | - "8080:8080" 47 | - "8081:8081" 48 | networks: 49 | - wpp-network 50 | depends_on: 51 | - wppconnect-front 52 | 53 | networks: 54 | wpp-network: 55 | name: wpp-network 56 | driver: bridge -------------------------------------------------------------------------------- /docker-server-front-dev/wppconnect-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:14.17-alpine3.13 2 | 3 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 4 | 5 | WORKDIR /home/node/app 6 | COPY ./app . 7 | 8 | RUN apk add chromium && \ 9 | yarn install 10 | 11 | EXPOSE 3000 -------------------------------------------------------------------------------- /docker-server-front-dev/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.15.0-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-front-dev/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8081; 3 | 4 | location / { 5 | 6 | add_header X-Frame-Options "SAMEORIGIN"; 7 | add_header X-XSS-Protection "1; mode=block"; 8 | add_header X-Content-Type-Options "nosniff"; 9 | 10 | charset utf-8; 11 | 12 | proxy_http_version 1.1; 13 | proxy_set_header Upgrade $http_upgrade; 14 | proxy_set_header Connection $http_connection; 15 | proxy_set_header Access-Control-Allow-Origin *; 16 | proxy_set_header Host $http_host; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 19 | proxy_set_header X-Forwarded-Proto $scheme; 20 | proxy_pass http://wppconnect-server:21465; 21 | } 22 | } 23 | 24 | server { 25 | listen 8080; 26 | 27 | location / { 28 | 29 | add_header X-Frame-Options "SAMEORIGIN"; 30 | add_header X-XSS-Protection "1; mode=block"; 31 | add_header X-Content-Type-Options "nosniff"; 32 | 33 | charset utf-8; 34 | 35 | proxy_http_version 1.1; 36 | proxy_set_header Upgrade $http_upgrade; 37 | proxy_set_header Connection $http_connection; 38 | proxy_set_header Access-Control-Allow-Origin *; 39 | proxy_set_header Host $host; 40 | proxy_set_header X-Real-IP $remote_addr; 41 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 42 | proxy_set_header X-Forwarded-Proto $scheme; 43 | proxy_pass http://wppconnect-front:3000; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /docker-server-front-dev/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 2 | 3 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 4 | 5 | WORKDIR /home/node/app 6 | COPY ./app . 7 | 8 | RUN apk add chromium && \ 9 | yarn install 10 | 11 | EXPOSE 21465 12 | -------------------------------------------------------------------------------- /docker-server-front-vue/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-server: 6 | build: 7 | context: ./wppconnect-server 8 | dockerfile: Dockerfile 9 | restart: always 10 | image: wppconnect-server 11 | container_name: wppconnect-server 12 | hostname: wppconnect-server 13 | entrypoint: docker-entrypoint.sh yarn dev 14 | networks: 15 | - wpp-network 16 | tty: true 17 | 18 | wppconnect-front: 19 | build: 20 | context: ./wppconnect-front 21 | dockerfile: Dockerfile 22 | image: wppconnect-front 23 | container_name: wppconnect-front 24 | hostname: wppconnect-front 25 | entrypoint: docker-entrypoint.sh npm run serve -- --port 3000 26 | networks: 27 | - wpp-network 28 | tty: true 29 | depends_on: 30 | - wppconnect-server 31 | 32 | wppconnect-nginx: 33 | build: 34 | context: ./wppconnect-nginx 35 | dockerfile: Dockerfile 36 | container_name: wppconnect-nginx 37 | entrypoint: nginx -g "daemon off;" 38 | ports: 39 | - "8080:8080" 40 | - "8081:8081" 41 | networks: 42 | - wpp-network 43 | depends_on: 44 | - wppconnect-front 45 | 46 | networks: 47 | wpp-network: 48 | name: wpp-network 49 | driver: bridge -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.16 as builder 2 | 3 | RUN apk add wget && \ 4 | apk add --no-cache git 5 | 6 | WORKDIR /home/node 7 | RUN git clone https://github.com/wppconnect-team/wppconnect-frontend-vue /home/node/app 8 | 9 | WORKDIR /home/node/app 10 | COPY ./config.js /home/node/app/public 11 | RUN npm install 12 | 13 | FROM node:lts-alpine3.16 14 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 15 | WORKDIR /home/node/app 16 | RUN apk add chromium 17 | COPY --from=builder /home/node/app/ . 18 | EXPOSE 3000 19 | -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-front/config.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | IP_SERVER: "http://localhost:8081/api/", 3 | IP_SOCKET_IO: "http://localhost:8081", 4 | TOKEN_KEY: "@WPPConnect-Token", 5 | LANGUAGE: "pt-BR", // Available: en-US, pt-BR, 6 | }; 7 | export default config; -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.15.0-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8081; 3 | 4 | location / { 5 | 6 | add_header X-Frame-Options "SAMEORIGIN"; 7 | add_header X-XSS-Protection "1; mode=block"; 8 | add_header X-Content-Type-Options "nosniff"; 9 | 10 | charset utf-8; 11 | 12 | proxy_http_version 1.1; 13 | proxy_set_header Upgrade $http_upgrade; 14 | proxy_set_header Connection $http_connection; 15 | proxy_set_header Access-Control-Allow-Origin *; 16 | proxy_set_header Host $http_host; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 19 | proxy_set_header X-Forwarded-Proto $scheme; 20 | proxy_pass http://wppconnect-server:21465; 21 | } 22 | } 23 | 24 | server { 25 | listen 8080; 26 | 27 | location / { 28 | 29 | add_header X-Frame-Options "SAMEORIGIN"; 30 | add_header X-XSS-Protection "1; mode=block"; 31 | add_header X-Content-Type-Options "nosniff"; 32 | 33 | charset utf-8; 34 | 35 | proxy_http_version 1.1; 36 | proxy_set_header Upgrade $http_upgrade; 37 | proxy_set_header Connection $http_connection; 38 | proxy_set_header Access-Control-Allow-Origin *; 39 | proxy_set_header Host $host; 40 | proxy_set_header X-Real-IP $remote_addr; 41 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 42 | proxy_set_header X-Forwarded-Proto $scheme; 43 | proxy_pass http://wppconnect-front:3000; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | ENV PORT=21465 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | 13 | COPY ./config.ts /home/node/app/src 14 | 15 | RUN yarn install 16 | 17 | FROM node:lts-alpine3.18 18 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 19 | WORKDIR /home/node/app 20 | RUN apk add chromium 21 | COPY --from=builder /home/node/app/ . 22 | EXPOSE 21465 23 | -------------------------------------------------------------------------------- /docker-server-front-vue/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | chatwoot: { 27 | sendQrCode: true, 28 | sendStatus: true, 29 | }, 30 | archive: { 31 | enable: false, 32 | waitTime: 10, 33 | daysToArchive: 45, 34 | }, 35 | log: { 36 | level: 'silly', // Before open a issue, change level to silly and retry a action 37 | logger: ['console', 'file'], 38 | }, 39 | createOptions: { 40 | browserArgs: [ 41 | '--disable-web-security', 42 | '--no-sandbox', 43 | '--disable-web-security', 44 | '--aggressive-cache-discard', 45 | '--disable-cache', 46 | '--disable-application-cache', 47 | '--disable-offline-load-stale-cache', 48 | '--disk-cache-size=0', 49 | '--disable-background-networking', 50 | '--disable-default-apps', 51 | '--disable-extensions', 52 | '--disable-sync', 53 | '--disable-translate', 54 | '--hide-scrollbars', 55 | '--metrics-recording-only', 56 | '--mute-audio', 57 | '--no-first-run', 58 | '--safebrowsing-disable-auto-update', 59 | '--ignore-certificate-errors', 60 | '--ignore-ssl-errors', 61 | '--ignore-certificate-errors-spki-list', 62 | ], 63 | }, 64 | mapper: { 65 | enable: false, 66 | prefix: 'tagone-', 67 | }, 68 | db: { 69 | mongodbDatabase: 'tokens', 70 | mongodbCollection: '', 71 | mongodbUser: '', 72 | mongodbPassword: '', 73 | mongodbHost: '', 74 | mongoIsRemote: true, 75 | mongoURLRemote: '', 76 | mongodbPort: 27017, 77 | redisHost: 'localhost', 78 | redisPort: 6379, 79 | redisPassword: '', 80 | redisDb: 0, 81 | redisPrefix: 'docker', 82 | }, 83 | aws_s3: { 84 | region: 'sa-east-1', 85 | access_key_id: null, 86 | secret_key: null, 87 | defaultBucketName: null, 88 | }, 89 | }; -------------------------------------------------------------------------------- /docker-server-front/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-server: 6 | build: 7 | context: ./wppconnect-server 8 | dockerfile: Dockerfile 9 | restart: always 10 | image: wppconnect-server 11 | container_name: wppconnect-server 12 | hostname: wppconnect-server 13 | entrypoint: docker-entrypoint.sh yarn dev 14 | networks: 15 | - wpp-network 16 | tty: true 17 | 18 | wppconnect-front: 19 | build: 20 | context: ./wppconnect-front 21 | dockerfile: Dockerfile 22 | image: wppconnect-front 23 | container_name: wppconnect-front 24 | hostname: wppconnect-front 25 | entrypoint: docker-entrypoint.sh yarn start 26 | networks: 27 | - wpp-network 28 | tty: true 29 | depends_on: 30 | - wppconnect-server 31 | 32 | wppconnect-nginx: 33 | build: 34 | context: ./wppconnect-nginx 35 | dockerfile: Dockerfile 36 | container_name: wppconnect-nginx 37 | entrypoint: nginx -g "daemon off;" 38 | ports: 39 | - "8080:8080" 40 | - "8081:8081" 41 | networks: 42 | - wpp-network 43 | depends_on: 44 | - wppconnect-front 45 | 46 | networks: 47 | wpp-network: 48 | name: wpp-network 49 | driver: bridge -------------------------------------------------------------------------------- /docker-server-front/wppconnect-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:14.17-alpine3.13 as builder 2 | 3 | RUN apk add wget && \ 4 | apk add --no-cache git 5 | 6 | WORKDIR /home/node 7 | RUN git clone https://github.com/wppconnect-team/wppconnect-frontend.git /home/node/app 8 | 9 | WORKDIR /home/node/app 10 | COPY ./config.js /home/node/app/public 11 | RUN yarn install 12 | 13 | FROM node:14.17-alpine3.13 14 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 15 | WORKDIR /home/node/app 16 | RUN apk add chromium 17 | COPY --from=builder /home/node/app/ . 18 | EXPOSE 3000 -------------------------------------------------------------------------------- /docker-server-front/wppconnect-front/config.js: -------------------------------------------------------------------------------- 1 | window.IP_SERVER = 'http://localhost:8081/api/'; 2 | window.IP_SOCKET_IO = 'http://localhost:8081'; -------------------------------------------------------------------------------- /docker-server-front/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.15.0-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-front/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8081; 3 | 4 | location / { 5 | 6 | add_header X-Frame-Options "SAMEORIGIN"; 7 | add_header X-XSS-Protection "1; mode=block"; 8 | add_header X-Content-Type-Options "nosniff"; 9 | 10 | charset utf-8; 11 | 12 | proxy_http_version 1.1; 13 | proxy_set_header Upgrade $http_upgrade; 14 | proxy_set_header Connection $http_connection; 15 | proxy_set_header Access-Control-Allow-Origin *; 16 | proxy_set_header Host $http_host; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 19 | proxy_set_header X-Forwarded-Proto $scheme; 20 | proxy_pass http://wppconnect-server:21465; 21 | } 22 | } 23 | 24 | server { 25 | listen 8080; 26 | 27 | location / { 28 | 29 | add_header X-Frame-Options "SAMEORIGIN"; 30 | add_header X-XSS-Protection "1; mode=block"; 31 | add_header X-Content-Type-Options "nosniff"; 32 | 33 | charset utf-8; 34 | 35 | proxy_http_version 1.1; 36 | proxy_set_header Upgrade $http_upgrade; 37 | proxy_set_header Connection $http_connection; 38 | proxy_set_header Access-Control-Allow-Origin *; 39 | proxy_set_header Host $host; 40 | proxy_set_header X-Real-IP $remote_addr; 41 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 42 | proxy_set_header X-Forwarded-Proto $scheme; 43 | proxy_pass http://wppconnect-front:3000; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /docker-server-front/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | 13 | COPY ./config.ts /home/node/app/src 14 | 15 | RUN yarn install 16 | 17 | FROM node:lts-alpine3.18 18 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 19 | WORKDIR /home/node/app 20 | RUN apk add chromium 21 | COPY --from=builder /home/node/app/ . 22 | EXPOSE 21465 23 | -------------------------------------------------------------------------------- /docker-server-front/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | chatwoot: { 27 | sendQrCode: true, 28 | sendStatus: true, 29 | }, 30 | archive: { 31 | enable: false, 32 | waitTime: 10, 33 | daysToArchive: 45, 34 | }, 35 | log: { 36 | level: 'silly', // Before open a issue, change level to silly and retry a action 37 | logger: ['console', 'file'], 38 | }, 39 | createOptions: { 40 | browserArgs: [ 41 | '--disable-web-security', 42 | '--no-sandbox', 43 | '--disable-web-security', 44 | '--aggressive-cache-discard', 45 | '--disable-cache', 46 | '--disable-application-cache', 47 | '--disable-offline-load-stale-cache', 48 | '--disk-cache-size=0', 49 | '--disable-background-networking', 50 | '--disable-default-apps', 51 | '--disable-extensions', 52 | '--disable-sync', 53 | '--disable-translate', 54 | '--hide-scrollbars', 55 | '--metrics-recording-only', 56 | '--mute-audio', 57 | '--no-first-run', 58 | '--safebrowsing-disable-auto-update', 59 | '--ignore-certificate-errors', 60 | '--ignore-ssl-errors', 61 | '--ignore-certificate-errors-spki-list', 62 | ], 63 | }, 64 | mapper: { 65 | enable: false, 66 | prefix: 'tagone-', 67 | }, 68 | db: { 69 | mongodbDatabase: 'tokens', 70 | mongodbCollection: '', 71 | mongodbUser: '', 72 | mongodbPassword: '', 73 | mongodbHost: '', 74 | mongoIsRemote: true, 75 | mongoURLRemote: '', 76 | mongodbPort: 27017, 77 | redisHost: 'localhost', 78 | redisPort: 6379, 79 | redisPassword: '', 80 | redisDb: 0, 81 | redisPrefix: 'docker', 82 | }, 83 | aws_s3: { 84 | region: 'sa-east-1', 85 | access_key_id: null, 86 | secret_key: null, 87 | defaultBucketName: null, 88 | }, 89 | }; -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-server-1: 6 | build: 7 | context: ./wppconnect-server 8 | dockerfile: Dockerfile 9 | restart: always 10 | image: wppconnect-server 11 | container_name: wppconnect-server-1 12 | hostname: wppconnect-server-1 13 | entrypoint: docker-entrypoint.sh yarn dev 14 | networks: 15 | wpp-network: 16 | ipv4_address: 172.20.0.2 17 | tty: true 18 | deploy: 19 | resources: 20 | limits: 21 | memory: 500M 22 | reservations: 23 | memory: 200M 24 | depends_on: 25 | - redis 26 | 27 | wppconnect-server-2: 28 | build: 29 | context: ./wppconnect-server 30 | dockerfile: Dockerfile 31 | restart: always 32 | image: wppconnect-server 33 | container_name: wppconnect-server-2 34 | hostname: wppconnect-server-2 35 | entrypoint: docker-entrypoint.sh yarn dev 36 | networks: 37 | wpp-network: 38 | ipv4_address: 172.20.0.3 39 | tty: true 40 | deploy: 41 | resources: 42 | limits: 43 | memory: 500M 44 | reservations: 45 | memory: 200M 46 | depends_on: 47 | - wppconnect-server-1 48 | - redis 49 | 50 | wppconnect-server-3: 51 | build: 52 | context: ./wppconnect-server 53 | dockerfile: Dockerfile 54 | restart: always 55 | image: wppconnect-server 56 | container_name: wppconnect-server-3 57 | hostname: wppconnect-server-3 58 | entrypoint: docker-entrypoint.sh yarn dev 59 | networks: 60 | wpp-network: 61 | ipv4_address: 172.20.0.4 62 | tty: true 63 | deploy: 64 | resources: 65 | limits: 66 | memory: 500M 67 | reservations: 68 | memory: 200M 69 | depends_on: 70 | - wppconnect-server-2 71 | - redis 72 | 73 | wppconnect-server-4: 74 | build: 75 | context: ./wppconnect-server 76 | dockerfile: Dockerfile 77 | restart: always 78 | image: wppconnect-server 79 | container_name: wppconnect-server-4 80 | hostname: wppconnect-server-4 81 | entrypoint: docker-entrypoint.sh yarn dev 82 | networks: 83 | wpp-network: 84 | ipv4_address: 172.20.0.5 85 | tty: true 86 | deploy: 87 | resources: 88 | limits: 89 | memory: 500M 90 | reservations: 91 | memory: 200M 92 | depends_on: 93 | - wppconnect-server-3 94 | - redis 95 | 96 | wppconnect-server-5: 97 | build: 98 | context: ./wppconnect-server 99 | dockerfile: Dockerfile 100 | restart: always 101 | image: wppconnect-server 102 | container_name: wppconnect-server-5 103 | hostname: wppconnect-server-5 104 | entrypoint: docker-entrypoint.sh yarn dev 105 | networks: 106 | wpp-network: 107 | ipv4_address: 172.20.0.6 108 | tty: true 109 | deploy: 110 | resources: 111 | limits: 112 | memory: 500M 113 | reservations: 114 | memory: 200M 115 | depends_on: 116 | - wppconnect-server-4 117 | - redis 118 | 119 | redis: 120 | restart: always 121 | image: redis 122 | container_name: redis 123 | hostname: redis 124 | ports: 125 | - "6379:6379" 126 | networks: 127 | wpp-network: 128 | ipv4_address: 172.20.0.7 129 | volumes: 130 | - ./redis-data:/data 131 | 132 | wppconnect-nginx: 133 | build: 134 | context: ./wppconnect-nginx 135 | dockerfile: Dockerfile 136 | container_name: wppconnect-nginx 137 | hostname: wppconnect-nginx 138 | entrypoint: nginx -g "daemon off;" 139 | ports: 140 | - "8081:8081" 141 | networks: 142 | wpp-network: 143 | ipv4_address: 172.20.0.8 144 | volumes: 145 | - ./wppconnect-nginx/conf.d:/etc/nginx/conf.d 146 | deploy: 147 | resources: 148 | limits: 149 | memory: 500M 150 | reservations: 151 | memory: 200M 152 | depends_on: 153 | - wppconnect-server-1 154 | - wppconnect-server-2 155 | - wppconnect-server-3 156 | - wppconnect-server-4 157 | - wppconnect-server-5 158 | - redis 159 | 160 | networks: 161 | wpp-network: 162 | name: wpp-network 163 | driver: bridge 164 | ipam: 165 | driver: default 166 | config: 167 | - subnet: 172.20.0.0/16 -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openresty/openresty:1.19.9.1-0-buster-fat 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf && \ 4 | rm /etc/openresty/nginx.conf 5 | 6 | COPY ./nginx.conf /etc/openresty 7 | #COPY ./conf.d/nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/conf.d/access.lua: -------------------------------------------------------------------------------- 1 | --ngx.log(ngx.WARN,'access_by_lua_block: '..ngx.var.request_uri.. ' :access_by_lua_block;') 2 | local hosts, ports, redis_server, redis_port = dofile("/etc/nginx/conf.d/hosts.lua") 3 | local total_server = #hosts --Quantidade de servidor wppconnect 4 | local controle_load = "posicao/" 5 | 6 | local t={} 7 | for str in string.gmatch(ngx.var.request_uri, "([^".."/".."]+)") do 8 | table.insert(t, str) 9 | end 10 | 11 | if t[1] ~= 'api' then 12 | ngx.say(ngx.ERR, "falha ao tentar ler a URI") 13 | return ngx.exit(501) 14 | end 15 | 16 | local session = t[2] 17 | 18 | local redis = require "resty.redis" 19 | local red = redis:new() 20 | 21 | local ok, err = red:connect(redis_server, redis_port) 22 | if not (type(ok) == "string" or type(ok) == "number") then 23 | ngx.say("falha ao conectar ao banco redis: ", err) 24 | return ngx.exit(501) 25 | end 26 | 27 | local posicao, err = red:get(session) 28 | if not (type(posicao) == "string" or type(posicao) == "number") then 29 | local posicao_atual, err = red:get(controle_load) 30 | if not (type(posicao_atual) == "string" or type(posicao_atual) == "number") then 31 | posicao_atual = 1 32 | else 33 | posicao_atual = posicao_atual + 1 34 | if posicao_atual > total_server then 35 | posicao_atual = 1 36 | end 37 | end 38 | 39 | local grava, err = red:set(controle_load, posicao_atual) 40 | if not (type(grava) == "string" or type(grava) == "number") then 41 | ngx.say("falha ao gravar posicao do servidor: ", err) 42 | return ngx.exit(501) 43 | end 44 | 45 | local grava, err = red:set(session, posicao_atual) 46 | if not (type(grava) == "string" or type(grava) == "number") then 47 | ngx.say("falha ao gravar a posicao da sessão: ", err) 48 | return ngx.exit(501) 49 | end 50 | ngx.header['posicao'] = posicao_atual 51 | else 52 | ngx.header['posicao'] = posicao 53 | end 54 | 55 | if t[3] == 'close-session' then 56 | red:del(session) 57 | end -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/conf.d/balance.lua: -------------------------------------------------------------------------------- 1 | local hosts, ports = dofile("/etc/nginx/conf.d/hosts.lua") 2 | 3 | local balancer = require "ngx.balancer" 4 | local host = hosts[tonumber(ngx.header['posicao'])] 5 | local port = ports[tonumber(ngx.header['posicao'])] 6 | 7 | local ok, err = balancer.set_current_peer(host, port) 8 | if not ok then 9 | ngx.log(ngx.ERR, "falha ao tentar balancear a rota: ", err) 10 | return ngx.exit(501) 11 | end -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/conf.d/hosts.lua: -------------------------------------------------------------------------------- 1 | local hosts = {"172.20.0.2", --IP dos servidores wppconect 2 | "172.20.0.3", 3 | "172.20.0.4", 4 | "172.20.0.5", 5 | "172.20.0.6" 6 | } 7 | 8 | local ports = {21465, --Portas dos servidores wppconect 9 | 21465, 10 | 21465, 11 | 21465, 12 | 21465 13 | } 14 | 15 | local redis_server = "172.20.0.7" 16 | local redis_port = 6379 17 | 18 | return hosts, ports, redis_server, redis_port -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | access_by_lua_file /etc/nginx/conf.d/access.lua; 2 | 3 | upstream wpp-servers{ 4 | #hash $wpp_session consistent; 5 | 6 | server 0.0.0.1; 7 | 8 | balancer_by_lua_file /etc/nginx/conf.d/balance.lua; 9 | 10 | keepalive 8; 11 | } 12 | 13 | server { 14 | client_max_body_size 100M; 15 | 16 | listen 8081; 17 | 18 | location / { 19 | add_header X-Frame-Options "SAMEORIGIN"; 20 | add_header X-XSS-Protection "1; mode=block"; 21 | add_header X-Content-Type-Options "nosniff"; 22 | add_header X-Upstream $upstream_addr always; 23 | 24 | charset utf-8; 25 | 26 | proxy_http_version 1.1; 27 | proxy_set_header Upgrade $http_upgrade; 28 | proxy_set_header Connection $http_connection; 29 | proxy_set_header Access-Control-Allow-Origin *; 30 | proxy_set_header Host $http_host; 31 | proxy_set_header X-Real-IP $remote_addr; 32 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 33 | proxy_set_header X-Forwarded-Proto $scheme; 34 | real_ip_header X-Real-IP; 35 | proxy_pass http://wpp-servers; 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | #user nginx; 2 | # Enables the use of JIT for regular expressions to speed-up their processing. 3 | pcre_jit on; 4 | 5 | worker_processes 1; 6 | 7 | error_log /usr/local/openresty/nginx/logs/error.log warn; 8 | pid /usr/local/openresty/nginx/logs/nginx.pid; 9 | 10 | events { 11 | worker_connections 1024; 12 | } 13 | 14 | http { 15 | include /usr/local/openresty/nginx/conf/mime.types; 16 | default_type application/octet-stream; 17 | client_max_body_size 100M; 18 | 19 | #MAP WPPSession 20 | map $uri $wpp_session{ 21 | default $uri; 22 | "~*/api/([a-zA-Z0-9]+)/(.*)$" $1; 23 | } 24 | 25 | log_format main '$wpp_session - $remote_addr - $remote_user [$time_local] "$request" ' 26 | '$status $body_bytes_sent "$http_referer" ' 27 | '"$http_user_agent" "$http_x_forwarded_for"'; 28 | 29 | access_log /usr/local/openresty/nginx/logs/access.log main; 30 | 31 | sendfile on; 32 | #tcp_nopush on; 33 | 34 | keepalive_timeout 65; 35 | 36 | #gzip on; 37 | 38 | include /etc/nginx/conf.d/*.conf; 39 | } -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | 13 | COPY ./config.ts /home/node/app/src 14 | 15 | RUN yarn install 16 | 17 | FROM node:lts-alpine3.18 18 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 19 | WORKDIR /home/node/app 20 | RUN apk add chromium 21 | COPY --from=builder /home/node/app/ . 22 | EXPOSE 21465 23 | -------------------------------------------------------------------------------- /docker-server-load-balancing-redis/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | chatwoot: { 27 | sendQrCode: true, 28 | sendStatus: true, 29 | }, 30 | archive: { 31 | enable: false, 32 | waitTime: 10, 33 | daysToArchive: 45, 34 | }, 35 | log: { 36 | level: 'silly', // Before open a issue, change level to silly and retry a action 37 | logger: ['console', 'file'], 38 | }, 39 | createOptions: { 40 | browserArgs: [ 41 | '--disable-web-security', 42 | '--no-sandbox', 43 | '--disable-web-security', 44 | '--aggressive-cache-discard', 45 | '--disable-cache', 46 | '--disable-application-cache', 47 | '--disable-offline-load-stale-cache', 48 | '--disk-cache-size=0', 49 | '--disable-background-networking', 50 | '--disable-default-apps', 51 | '--disable-extensions', 52 | '--disable-sync', 53 | '--disable-translate', 54 | '--hide-scrollbars', 55 | '--metrics-recording-only', 56 | '--mute-audio', 57 | '--no-first-run', 58 | '--safebrowsing-disable-auto-update', 59 | '--ignore-certificate-errors', 60 | '--ignore-ssl-errors', 61 | '--ignore-certificate-errors-spki-list', 62 | ], 63 | }, 64 | mapper: { 65 | enable: false, 66 | prefix: 'tagone-', 67 | }, 68 | db: { 69 | mongodbDatabase: 'tokens', 70 | mongodbCollection: '', 71 | mongodbUser: '', 72 | mongodbPassword: '', 73 | mongodbHost: '', 74 | mongoIsRemote: true, 75 | mongoURLRemote: '', 76 | mongodbPort: 27017, 77 | redisHost: 'localhost', 78 | redisPort: 6379, 79 | redisPassword: '', 80 | redisDb: 0, 81 | redisPrefix: 'docker', 82 | }, 83 | aws_s3: { 84 | region: 'sa-east-1', 85 | access_key_id: null, 86 | secret_key: null, 87 | defaultBucketName: null, 88 | }, 89 | }; -------------------------------------------------------------------------------- /docker-server-load-balancing/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-server-1: 6 | build: 7 | context: ./wppconnect-server 8 | dockerfile: Dockerfile 9 | restart: always 10 | image: wppconnect-server 11 | container_name: wppconnect-server-1 12 | hostname: wppconnect-server 13 | entrypoint: docker-entrypoint.sh yarn dev 14 | networks: 15 | wpp-network: 16 | ipv4_address: 172.20.0.2 17 | tty: true 18 | deploy: 19 | resources: 20 | limits: 21 | memory: 500M 22 | reservations: 23 | memory: 200M 24 | 25 | wppconnect-server-2: 26 | build: 27 | context: ./wppconnect-server 28 | dockerfile: Dockerfile 29 | restart: always 30 | image: wppconnect-server 31 | container_name: wppconnect-server-2 32 | hostname: wppconnect-server 33 | entrypoint: docker-entrypoint.sh yarn dev 34 | networks: 35 | wpp-network: 36 | ipv4_address: 172.20.0.3 37 | tty: true 38 | deploy: 39 | resources: 40 | limits: 41 | memory: 500M 42 | reservations: 43 | memory: 200M 44 | depends_on: 45 | - wppconnect-server-1 46 | 47 | wppconnect-server-3: 48 | build: 49 | context: ./wppconnect-server 50 | dockerfile: Dockerfile 51 | restart: always 52 | image: wppconnect-server 53 | container_name: wppconnect-server-3 54 | hostname: wppconnect-server 55 | entrypoint: docker-entrypoint.sh yarn dev 56 | networks: 57 | wpp-network: 58 | ipv4_address: 172.20.0.4 59 | tty: true 60 | deploy: 61 | resources: 62 | limits: 63 | memory: 500M 64 | reservations: 65 | memory: 200M 66 | depends_on: 67 | - wppconnect-server-2 68 | 69 | wppconnect-server-4: 70 | build: 71 | context: ./wppconnect-server 72 | dockerfile: Dockerfile 73 | restart: always 74 | image: wppconnect-server 75 | container_name: wppconnect-server-4 76 | hostname: wppconnect-server 77 | entrypoint: docker-entrypoint.sh yarn dev 78 | networks: 79 | wpp-network: 80 | ipv4_address: 172.20.0.5 81 | tty: true 82 | deploy: 83 | resources: 84 | limits: 85 | memory: 500M 86 | reservations: 87 | memory: 200M 88 | depends_on: 89 | - wppconnect-server-3 90 | 91 | wppconnect-server-5: 92 | build: 93 | context: ./wppconnect-server 94 | dockerfile: Dockerfile 95 | restart: always 96 | image: wppconnect-server 97 | container_name: wppconnect-server-5 98 | hostname: wppconnect-server 99 | entrypoint: docker-entrypoint.sh yarn dev 100 | networks: 101 | wpp-network: 102 | ipv4_address: 172.20.0.6 103 | tty: true 104 | deploy: 105 | resources: 106 | limits: 107 | memory: 500M 108 | reservations: 109 | memory: 200M 110 | depends_on: 111 | - wppconnect-server-4 112 | 113 | wppconnect-nginx: 114 | build: 115 | context: ./wppconnect-nginx 116 | dockerfile: Dockerfile 117 | container_name: wppconnect-nginx 118 | hostname: wppconnect-nginx 119 | entrypoint: nginx -g "daemon off;" 120 | ports: 121 | - "8081:8081" 122 | networks: 123 | wpp-network: 124 | ipv4_address: 172.20.0.7 125 | deploy: 126 | resources: 127 | limits: 128 | memory: 500M 129 | reservations: 130 | memory: 200M 131 | depends_on: 132 | - wppconnect-server-1 133 | - wppconnect-server-2 134 | - wppconnect-server-3 135 | - wppconnect-server-4 136 | - wppconnect-server-5 137 | 138 | networks: 139 | wpp-network: 140 | name: wpp-network 141 | driver: bridge 142 | ipam: 143 | driver: default 144 | config: 145 | - subnet: 172.20.0.0/16 -------------------------------------------------------------------------------- /docker-server-load-balancing/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.15.0-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf && \ 4 | rm /etc/nginx/nginx.conf 5 | 6 | COPY ./nginx.conf /etc/nginx/ 7 | COPY ./conf.d/nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-load-balancing/wppconnect-nginx/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | upstream wpp-servers{ 2 | #server wppconnect-server-1:21465 weight=6 max_fails=5 fail_timeout=300; 3 | hash $wpp_session consistent; 4 | 5 | server wppconnect-server-1:21465; 6 | server wppconnect-server-2:21465; 7 | server wppconnect-server-3:21465; 8 | server wppconnect-server-4:21465; 9 | server wppconnect-server-5:21465; 10 | 11 | keepalive 8; 12 | } 13 | 14 | server { 15 | 16 | listen 8081; 17 | 18 | location / { 19 | 20 | add_header X-Frame-Options "SAMEORIGIN"; 21 | add_header X-XSS-Protection "1; mode=block"; 22 | add_header X-Content-Type-Options "nosniff"; 23 | add_header X-Upstream $upstream_addr always; 24 | 25 | charset utf-8; 26 | 27 | proxy_http_version 1.1; 28 | proxy_set_header Upgrade $http_upgrade; 29 | proxy_set_header Connection $http_connection; 30 | proxy_set_header Access-Control-Allow-Origin *; 31 | proxy_set_header Host $http_host; 32 | proxy_set_header X-Real-IP $remote_addr; 33 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 34 | proxy_set_header X-Forwarded-Proto $scheme; 35 | real_ip_header X-Real-IP; 36 | proxy_pass http://wpp-servers; 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /docker-server-load-balancing/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | events { 8 | worker_connections 1024; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | #MAP WPPSession 16 | map $uri $wpp_session{ 17 | default $uri; 18 | "~*/api/([a-zA-Z0-9]+)/(.*)$" $1; 19 | } 20 | 21 | log_format main '$wpp_session - $remote_addr - $remote_user [$time_local] "$request" ' 22 | '$status $body_bytes_sent "$http_referer" ' 23 | '"$http_user_agent" "$http_x_forwarded_for"'; 24 | 25 | access_log /var/log/nginx/access.log main; 26 | 27 | sendfile on; 28 | #tcp_nopush on; 29 | 30 | keepalive_timeout 65; 31 | 32 | #gzip on; 33 | 34 | include /etc/nginx/conf.d/*.conf; 35 | } -------------------------------------------------------------------------------- /docker-server-load-balancing/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | ENV PORT=21465 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | 13 | COPY ./config.ts /home/node/app/src 14 | 15 | RUN yarn install 16 | 17 | FROM node:lts-alpine3.18 18 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 19 | WORKDIR /home/node/app 20 | RUN apk add chromium 21 | COPY --from=builder /home/node/app/ . 22 | EXPOSE 21465 23 | -------------------------------------------------------------------------------- /docker-server-load-balancing/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | chatwoot: { 27 | sendQrCode: true, 28 | sendStatus: true, 29 | }, 30 | archive: { 31 | enable: false, 32 | waitTime: 10, 33 | daysToArchive: 45, 34 | }, 35 | log: { 36 | level: 'silly', // Before open a issue, change level to silly and retry a action 37 | logger: ['console', 'file'], 38 | }, 39 | createOptions: { 40 | browserArgs: [ 41 | '--disable-web-security', 42 | '--no-sandbox', 43 | '--disable-web-security', 44 | '--aggressive-cache-discard', 45 | '--disable-cache', 46 | '--disable-application-cache', 47 | '--disable-offline-load-stale-cache', 48 | '--disk-cache-size=0', 49 | '--disable-background-networking', 50 | '--disable-default-apps', 51 | '--disable-extensions', 52 | '--disable-sync', 53 | '--disable-translate', 54 | '--hide-scrollbars', 55 | '--metrics-recording-only', 56 | '--mute-audio', 57 | '--no-first-run', 58 | '--safebrowsing-disable-auto-update', 59 | '--ignore-certificate-errors', 60 | '--ignore-ssl-errors', 61 | '--ignore-certificate-errors-spki-list', 62 | ], 63 | }, 64 | mapper: { 65 | enable: false, 66 | prefix: 'tagone-', 67 | }, 68 | db: { 69 | mongodbDatabase: 'tokens', 70 | mongodbCollection: '', 71 | mongodbUser: '', 72 | mongodbPassword: '', 73 | mongodbHost: '', 74 | mongoIsRemote: true, 75 | mongoURLRemote: '', 76 | mongodbPort: 27017, 77 | redisHost: 'localhost', 78 | redisPort: 6379, 79 | redisPassword: '', 80 | redisDb: 0, 81 | redisPrefix: 'docker', 82 | }, 83 | aws_s3: { 84 | region: 'sa-east-1', 85 | access_key_id: null, 86 | secret_key: null, 87 | defaultBucketName: null, 88 | }, 89 | }; -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | wppconnect-mysql: 6 | image: mysql:5.7 7 | container_name: wppconnect-mysql 8 | command: --innodb-use-native-aio=0 9 | restart: always 10 | tty: true 11 | volumes: 12 | - ./wppconnect-mysql/sql/db_table.sql:/docker-entrypoint-initdb.d/db_table.sql 13 | - ./wppconnect-mysql/db:/var/lib/mysql 14 | environment: 15 | - MYSQL_DATABASE=wpp_db 16 | - MYSQL_ROOT_PASSWORD=root 17 | ports: 18 | - 3306:3306 19 | networks: 20 | - wpp-network 21 | 22 | wppconnect-phpmyadmin: 23 | image: phpmyadmin/phpmyadmin:latest 24 | container_name: wppconnect-phpmyadmin 25 | restart: always 26 | environment: 27 | PMA_HOST: wppconnect-mysql 28 | PMA_DB: wpp_db 29 | PMA_USER: root 30 | PMA_PASSWORD: root 31 | PMA_ARBITRARY: 1 32 | depends_on: 33 | - wppconnect-mysql 34 | networks: 35 | - wpp-network 36 | 37 | wppconnect-server: 38 | build: 39 | context: ./wppconnect-server 40 | dockerfile: Dockerfile 41 | image: wppconnect-server 42 | restart: always 43 | container_name: wppconnect-server 44 | hostname: wppconnect-server 45 | entrypoint: dockerize -wait tcp://wppconnect-mysql:3306 -timeout 20s docker-entrypoint.sh yarn dev 46 | networks: 47 | - wpp-network 48 | tty: true 49 | depends_on: 50 | - wppconnect-mysql 51 | 52 | wppconnect-php-client: 53 | build: 54 | context: ./wppconnect-php-client 55 | dockerfile: Dockerfile 56 | image: wppconnect-php-client 57 | container_name: wppconnect-php-client 58 | hostname: wppconnect-php-client 59 | volumes: 60 | - ./wppconnect-php-client/app/html:/var/www/html 61 | networks: 62 | - wpp-network 63 | tty: true 64 | depends_on: 65 | - wppconnect-server 66 | 67 | wppconnect-nginx: 68 | build: 69 | context: ./wppconnect-nginx 70 | dockerfile: Dockerfile 71 | container_name: wppconnect-nginx 72 | entrypoint: nginx -g "daemon off;" 73 | ports: 74 | - "8080:8080" #php-client 75 | - "8081:8081" #wppconnect-server 76 | - "8082:8082" #phpmyadmin 77 | networks: 78 | - wpp-network 79 | depends_on: 80 | - wppconnect-php-client 81 | 82 | networks: 83 | wpp-network: 84 | name: wpp-network 85 | driver: bridge -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-mysql/db/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wppconnect-team/wpp-docker/b779d7d93e1ad5485dea0f18b48501db5a5687b4/docker-server-php-mysql-dev/wppconnect-mysql/db/.gitignore -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-mysql/sql/db_table.sql: -------------------------------------------------------------------------------- 1 | USE wpp_db; 2 | CREATE TABLE `wpp_db`.`chat` ( 3 | `id` INT NOT NULL AUTO_INCREMENT, 4 | `session` VARCHAR(255) NOT NULL, 5 | `from_number` VARCHAR(45) NULL, 6 | `to_number` VARCHAR(45) NULL, 7 | `content` LONGTEXT NULL, 8 | `type` VARCHAR(45) NOT NULL, 9 | `file_name` VARCHAR(255) NULL, 10 | `create_at` DATETIME NOT NULL, 11 | PRIMARY KEY (`id`)) 12 | ENGINE = InnoDB 13 | DEFAULT CHARACTER SET = utf8mb4 14 | COLLATE = utf8mb4_unicode_ci; -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.15.0-alpine 2 | 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8080; 3 | index index.php index.html; 4 | root /var/www/html; 5 | 6 | add_header X-Frame-Options "SAMEORIGIN"; 7 | add_header X-XSS-Protection "1; mode=block"; 8 | add_header X-Content-Type-Options "nosniff"; 9 | 10 | charset utf-8; 11 | 12 | location ~ \.php$ { 13 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 14 | fastcgi_pass wppconnect-php-client:9000; 15 | fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; 16 | include fastcgi_params; 17 | } 18 | 19 | location / { 20 | try_files $uri $uri/ /index.php?$query_string; 21 | } 22 | 23 | location = /favicon.ico { access_log off; log_not_found off; } 24 | location = /robots.txt { access_log off; log_not_found off; } 25 | 26 | error_page 404 /index.php; 27 | 28 | location ~ /\.(?!well-known).* { 29 | deny all; 30 | } 31 | } 32 | 33 | server { 34 | listen 8081; 35 | 36 | location / { 37 | 38 | add_header X-Frame-Options "SAMEORIGIN"; 39 | add_header X-XSS-Protection "1; mode=block"; 40 | add_header X-Content-Type-Options "nosniff"; 41 | 42 | charset utf-8; 43 | 44 | proxy_http_version 1.1; 45 | proxy_set_header Upgrade $http_upgrade; 46 | proxy_set_header Connection $http_connection; 47 | proxy_set_header Access-Control-Allow-Origin *; 48 | proxy_set_header Host $http_host; 49 | proxy_set_header X-Real-IP $remote_addr; 50 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 51 | proxy_set_header X-Forwarded-Proto $scheme; 52 | proxy_pass http://wppconnect-server:21465; 53 | } 54 | } 55 | 56 | server { 57 | listen 8082; 58 | 59 | underscores_in_headers on; 60 | 61 | location / { 62 | 63 | add_header X-Frame-Options "SAMEORIGIN"; 64 | add_header X-XSS-Protection "1; mode=block"; 65 | add_header X-Content-Type-Options "nosniff"; 66 | 67 | charset utf-8; 68 | 69 | proxy_http_version 1.1; 70 | proxy_set_header Upgrade $http_upgrade; 71 | proxy_set_header Connection $http_connection; 72 | proxy_set_header Access-Control-Allow-Origin *; 73 | proxy_set_header Host $http_host; 74 | proxy_set_header X-Real-IP $remote_addr; 75 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 76 | proxy_set_header X-Forwarded-Proto $scheme; 77 | proxy_pass http://wppconnect-phpmyadmin:80; 78 | } 79 | } -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-php-client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0.10-fpm-alpine3.14 as builder 2 | 3 | WORKDIR /var/www 4 | 5 | RUN rm -rf /var/www/html 6 | COPY ./app /var/www 7 | 8 | RUN apk add --no-cache zip libzip-dev 9 | RUN docker-php-ext-configure zip && \ 10 | docker-php-ext-install zip && \ 11 | docker-php-ext-install mysqli pdo pdo_mysql && \ 12 | docker-php-ext-enable pdo_mysql 13 | 14 | RUN chown -R www-data:www-data /var/www 15 | 16 | EXPOSE 9000 17 | CMD [ "php-fpm" ] -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-php-client/app/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "wppconnect-team/wppconnect-php-client": "^2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-php-client/app/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "869fa28b1a0f1fba6cf67d74b88814ad", 8 | "packages": [ 9 | { 10 | "name": "squizlabs/php_codesniffer", 11 | "version": "3.6.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 15 | "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", 20 | "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-simplexml": "*", 25 | "ext-tokenizer": "*", 26 | "ext-xmlwriter": "*", 27 | "php": ">=5.4.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 31 | }, 32 | "bin": [ 33 | "bin/phpcs", 34 | "bin/phpcbf" 35 | ], 36 | "type": "library", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "3.x-dev" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "BSD-3-Clause" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Greg Sherwood", 49 | "role": "lead" 50 | } 51 | ], 52 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 53 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 54 | "keywords": [ 55 | "phpcs", 56 | "standards" 57 | ], 58 | "support": { 59 | "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", 60 | "source": "https://github.com/squizlabs/PHP_CodeSniffer", 61 | "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" 62 | }, 63 | "time": "2021-04-09T00:54:41+00:00" 64 | }, 65 | { 66 | "name": "wppconnect-team/wppconnect-php-client", 67 | "version": "v2.0.2", 68 | "source": { 69 | "type": "git", 70 | "url": "https://github.com/wppconnect-team/wppconnect-php-client.git", 71 | "reference": "265ba7ba26fedc8616d8433c2ffbd5f166880964" 72 | }, 73 | "dist": { 74 | "type": "zip", 75 | "url": "https://api.github.com/repos/wppconnect-team/wppconnect-php-client/zipball/265ba7ba26fedc8616d8433c2ffbd5f166880964", 76 | "reference": "265ba7ba26fedc8616d8433c2ffbd5f166880964", 77 | "shasum": "" 78 | }, 79 | "require": { 80 | "php": ">=7.3", 81 | "squizlabs/php_codesniffer": "3.6.0" 82 | }, 83 | "type": "libr", 84 | "autoload": { 85 | "psr-4": { 86 | "WPPConnect\\": "src/" 87 | } 88 | }, 89 | "notification-url": "https://packagist.org/downloads/", 90 | "license": [ 91 | "Apache-2.0" 92 | ], 93 | "authors": [ 94 | { 95 | "name": "bgastaldi" 96 | } 97 | ], 98 | "description": "Um simples cliente PHP que proporciona acesso fácil aos endpoints do WPPConnect Server.", 99 | "homepage": "https://github.com/wppconnect-team/wppconnect-php-client", 100 | "keywords": [ 101 | "php", 102 | "rest client", 103 | "wppconnect" 104 | ], 105 | "support": { 106 | "issues": "https://github.com/wppconnect-team/wppconnect-php-client/issues", 107 | "source": "https://github.com/wppconnect-team/wppconnect-php-client/tree/v2.0.2" 108 | }, 109 | "time": "2021-09-06T20:52:34+00:00" 110 | } 111 | ], 112 | "packages-dev": [], 113 | "aliases": [], 114 | "minimum-stability": "stable", 115 | "stability-flags": [], 116 | "prefer-stable": false, 117 | "prefer-lowest": false, 118 | "platform": [], 119 | "platform-dev": [], 120 | "plugin-api-version": "2.1.0" 121 | } 122 | -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-php-client/app/html/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wppconnect-team/wpp-docker/b779d7d93e1ad5485dea0f18b48501db5a5687b4/docker-server-php-mysql-dev/wppconnect-php-client/app/html/.gitignore -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.18 as builder 2 | 3 | ENV PORT=21465 4 | 5 | RUN apk add wget && \ 6 | apk add --no-cache git 7 | 8 | WORKDIR /home/node 9 | RUN git clone https://github.com/wppconnect-team/wppconnect-server.git /home/node/app 10 | 11 | WORKDIR /home/node/app 12 | COPY ./config.ts /home/node/app/src 13 | RUN yarn install 14 | 15 | FROM node:lts-alpine3.18 16 | ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true 17 | WORKDIR /home/node/app 18 | RUN apk add chromium 19 | RUN apk update && apk add wget 20 | 21 | ENV DOCKERIZE_VERSION v0.6.1 22 | RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ 23 | && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ 24 | && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz 25 | 26 | COPY --from=builder /home/node/app/ . 27 | EXPOSE 21465 28 | -------------------------------------------------------------------------------- /docker-server-php-mysql-dev/wppconnect-server/config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | secretKey: 'THISISMYSECURETOKEN', 3 | host: 'http://localhost', 4 | port: '21465', 5 | deviceName: 'WppConnect', 6 | poweredBy: 'WPPConnect-Server', 7 | startAllSession: true, 8 | tokenStoreType: 'file', 9 | maxListeners: 15, 10 | customUserDataDir: './userDataDir/', 11 | webhook: { 12 | url: null, 13 | autoDownload: true, 14 | uploadS3: false, 15 | readMessage: true, 16 | allUnreadOnStart: false, 17 | listenAcks: true, 18 | onPresenceChanged: true, 19 | onParticipantsChanged: true, 20 | onReactionMessage: true, 21 | onPollResponse: true, 22 | onRevokedMessage: true, 23 | onLabelUpdated: true, 24 | onSelfMessage: false, 25 | }, 26 | chatwoot: { 27 | sendQrCode: true, 28 | sendStatus: true, 29 | }, 30 | archive: { 31 | enable: false, 32 | waitTime: 10, 33 | daysToArchive: 45, 34 | }, 35 | log: { 36 | level: 'silly', // Before open a issue, change level to silly and retry a action 37 | logger: ['console', 'file'], 38 | }, 39 | createOptions: { 40 | browserArgs: [ 41 | '--disable-web-security', 42 | '--no-sandbox', 43 | '--disable-web-security', 44 | '--aggressive-cache-discard', 45 | '--disable-cache', 46 | '--disable-application-cache', 47 | '--disable-offline-load-stale-cache', 48 | '--disk-cache-size=0', 49 | '--disable-background-networking', 50 | '--disable-default-apps', 51 | '--disable-extensions', 52 | '--disable-sync', 53 | '--disable-translate', 54 | '--hide-scrollbars', 55 | '--metrics-recording-only', 56 | '--mute-audio', 57 | '--no-first-run', 58 | '--safebrowsing-disable-auto-update', 59 | '--ignore-certificate-errors', 60 | '--ignore-ssl-errors', 61 | '--ignore-certificate-errors-spki-list', 62 | ], 63 | }, 64 | mapper: { 65 | enable: false, 66 | prefix: 'tagone-', 67 | }, 68 | db: { 69 | mongodbDatabase: 'tokens', 70 | mongodbCollection: '', 71 | mongodbUser: '', 72 | mongodbPassword: '', 73 | mongodbHost: '', 74 | mongoIsRemote: true, 75 | mongoURLRemote: '', 76 | mongodbPort: 27017, 77 | redisHost: 'localhost', 78 | redisPort: 6379, 79 | redisPassword: '', 80 | redisDb: 0, 81 | redisPrefix: 'docker', 82 | }, 83 | aws_s3: { 84 | region: 'sa-east-1', 85 | access_key_id: null, 86 | secret_key: null, 87 | defaultBucketName: null, 88 | }, 89 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wpp-docker", 3 | "version": "1.0.0", 4 | "description": "Easily build Docker images with different versions/combinations of common languages/dependencies, for use on WPPConnect.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/wppconnect-team/wpp-docker.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/wppconnect-team/wpp-docker/issues" 17 | }, 18 | "homepage": "https://github.com/wppconnect-team/wpp-docker#readme", 19 | "devDependencies": { 20 | "@commitlint/cli": "^12.1.4", 21 | "@commitlint/config-conventional": "^12.1.4", 22 | "cz-conventional-changelog": "^3.3.0", 23 | "husky": "^6.0.0" 24 | }, 25 | "config": { 26 | "commitizen": { 27 | "path": "./node_modules/cz-conventional-changelog" 28 | } 29 | } 30 | } --------------------------------------------------------------------------------