From 5a09eb6514e3f1b503f248674693839f4f07e408 Mon Sep 17 00:00:00 2001 From: Ricardo Paes Date: Tue, 15 Feb 2022 06:34:56 -0300 Subject: [PATCH] Adding documentation to run using docker --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f13b45..a717589 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,9 @@ npm start - Wait for QR CODE button to appear, click it and read qr code. - Done. Every message received by your synced WhatsApp number will appear in Tickets List. -## Basic production deployment (Ubuntu 20.04 VPS) +## Basic production deployment + +### Using Ubuntu 20.04 VPS All instructions below assumes you are NOT running as root, since it will give an error in puppeteer. So let's start creating a new user and granting sudo privileges to it: @@ -373,6 +375,40 @@ Enable SSL on nginx (Fill / Accept all information required): sudo certbot --nginx ``` +### Using docker and docker-compose + +To run WhaTicket using docker you must perform the following steps: + +```bash +cp .env.example .env +``` + +Now it will be necessary to configure the .env using its information, the variables are the same as those mentioned in the deployment using ubuntu, with the exception of mysql settings that were not in the .env. + +To deploy the ssl certificate, add it to the `ssl/certs` folder. Inside it there should be a `backend` and a `frontend` folder, and each of them should contain the files `fullchain.pem` and `privkey.pem`, as in the structure below: + +```bash +. +├── certs +│   ├── backend +│   │   ├── fullchain.pem +│   │   └── privkey.pem +│   └── frontend +│   ├── fullchain.pem +│   └── privkey.pem +└── www +``` + +To generate the certificate files use `certbot` which can be installed using snap, I used the following command: + +```bash +# FRONTEND +certbot certonly --cert-name backend --webroot --webroot-path ./ssl/www/ -d api.mydomain.com + +# BACKEND +certbot certonly --cert-name frontend --webroot --webroot-path ./ssl/www/ -d myapp.mydomain.com +``` + ## Access Data User: admin@whaticket.com