-
Notifications
You must be signed in to change notification settings - Fork 2
Deploy with Docker
1. Install Docker
Follow the official Docker Installation Guide
2. Install Docker-Compose
The easiest way to install docker-compose is:
$ sudo pip install docker-compose
OR also you can check other official methods of installing docker-compose here
3.Download Setup Files
Download the sample config file
$ mkdir worker && cd worker
wget https://raw.githubusercontent.com/Upstats/Utils/main/config.env
vim config.env
- Setup Database MongoDB
DB_URI = "MongoDB URI"
- If you want mailing service add your smtp details to config.env
smtp_host = "smtp.gmail.com"
smtp_port = 465
smtp_user = "[email protected]"
smtp_pass = "---password---"
-
If you want to enable Telegram Bots Support, Set your Own Credentials.
-
To generate Session String, simply run
npx telegram
in terminal and provide required details.
tg_session - Telegram Session String
api_id - Telegram App API ID, get it from my.telegram.org
api_hash - Telegram App API Hash, get it from my.telegram.org
Download the yaml file for docker-compose
$ wget https://raw.githubusercontent.com/Upstats/Utils/main/docker-compose.yml
4.Run Worker
$ docker-compose up -d
The worker should be running now. Check logs with
$ docker-compose logs -f
Q. How to Stop the Worker?
To stop the running worker in Docker use this Stop Command
$ docker-compose stop
This will just stop the containers. Built images won’t be removed. So next time you can start with this command
$ docker-compose start
It won’t take time for building from scratch.
To delete the built image of Worker. Use this Down command
$ docker-compose down
You can stop and delete the built images also. So next time you have to do this to start the worker.
$ docker-compose up -d
Q. How to Update the Worker?
$ docker-compose up -d
Changes will be fetched from git repo. You can change repo url from docker-compose.yml file.