echo ngrokAuthToken="your-auth-token" > .env
The privkey (as key.pem) and fullchain (as cert.pem) certificates must be in the Nginx/certs folder when starting the project. Quick installation of certificates (if you use a сertbot).
cp /etc/letsencrypt/live/your_host_address.com/fullchain.pem KAIFreeAudiencesBotProject/Nginx/certs/cert.pem
cp /etc/letsencrypt/live/your_host_address.com/privkey.pem KAIFreeAudiencesBotProject/Nginx/certs/key.pem
Be sure you set the port and address in docker-compose.yaml
environment:
- NGINX_HOST=your_host_address.com #set your host address
- NGINX_PORT=443 #set your port (80, 88, 443, 8443)
cp KAIFreeAudiencesBot/KAIFreeAudiencesBot/appsettings.example KAIFreeAudiencesBot/KAIFreeAudiencesBot/appsettings.json
nano KAIFreeAudiencesBot/KAIFreeAudiencesBot/appsettings.json
You need to replace the values in BotConfiguration: HostAddress and BotApiKey.
Leave value in HostAddress blank for auto detection when using ngrok.
{
"ConnectionStrings": {
"ScheduleConnectionSqlite": "Data Source=//db//schedule.db"
},
"BotConfiguration": {
"HostAddress": "https://host.address",
"BotApiKey": "bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
docker compose build
docker compose up -d
It is supported to launch a telegram bot using both ngrok (for debugging) and using nginx to fulfill the telegram requirements for traffic encryption.
-
Start containers in debug mode (ngrok)
docker compose --profile debug up -d
-
Start containers in production mode (nginx)
docker compose --profile prod up -d
docker compose down
See more instructions here.
docker compose run parser bash