Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pajbot in a docker container #806

Open
RAnders00 opened this issue Aug 22, 2022 · 4 comments
Open

Running pajbot in a docker container #806

RAnders00 opened this issue Aug 22, 2022 · 4 comments

Comments

@RAnders00
Copy link
Contributor

Discussed in pajbot/pajbot#2091

Originally posted by Mateyoo August 20, 2022
Hi!

In March, I tried running pajbot in a docker container via docker-compose but I didn't have much success.
I think it would be a good idea to make a docker documentation for the bot, so those people who don't have a spare server for hosting the bot could do it by using docker.

@Mateyoo
Copy link

Mateyoo commented Aug 29, 2022

I tried running the bot with the following docker-compose.yml file:

version: '3'
services:
 pajbot:
  image: leppunen/pajbot2:latest
  restart: unless-stopped
  environment:
    - VIRTUAL_HOST=bot.redacted.tld
    - LETSENCRYPT_HOST=bot.redacted.tld
    - VIRTUAL_PORT=80
  networks:
    - public_services
 # (public_services = my nginx reverse proxy)
  volumes:
    - ./configs/pajbot2.json:/app/cmd/bot/config.json
    - ./db:/var/run/postgresql:ro
    - /etc/localtime:/etc/localtime:ro

networks:
  public_services: 
    external: true

You'll have to make a configs folder, and then a pajbot2.json, because docker will think that pajbot2.json is a folder.

@Mateyoo
Copy link

Mateyoo commented Aug 29, 2022

I tried running the bot with the following docker-compose.yml file:

The only problem I had when running it is this:

When I pasted the example config file, I got this error:

root@mateyo-vps-1:~/docker/pajbot# docker-compose up 
Recreating pajbot_pajbot_1 ... done
Attaching to pajbot_pajbot_1
pajbot_1  | 2022/08/20 23:27:41 An error occurred while loading the config file: invalid character 'm' looking for beginning of value

When I made an empty config file, I got this error:

root@mateyo-vps-1:~/docker/pajbot/configs# touch pajbot2.json
root@mateyo-vps-1:~/docker/pajbot/configs# cd .. && docker-compose up
Creating pajbot_pajbot_1 ... done
Attaching to pajbot_pajbot_1
pajbot_1  | 2022/08/20 23:30:15 An error occurred while loading the config file: unexpected end of JSON input

PS (2022. 08. 29. 20:14 UTC+2):
I just realised that I wanted to paste an ini file's content into a json file. :D

@Mateyoo
Copy link

Mateyoo commented Aug 31, 2022

PS (2022. 08. 29. 20:14 UTC+2): I just realised that I wanted to paste an ini file's content into a json file. :D

I formatted the example.ini file into a json file, and now when I try to start the bot, I get this error:

root@mateyo-vps-1:~/docker/pajbot# docker-compose up -d
Creating network "pajbot_pajbot_db" with the default driver
Creating pajbot_db_1     ... done
Creating pajbot_pajbot_1 ... done
root@mateyo-vps-1:~/docker/pajbot# docker logs pajbot_pajbot_1
2022/08/31 11:54:09 An error occurred while loading the config file: twitch WebHook secret must be at least 10 characters and at most 100 characters
2022/08/31 11:54:11 An error occurred while loading the config file: twitch WebHook secret must be at least 10 characters and at most 100 characters

@pajlada pajlada transferred this issue from pajbot/pajbot Aug 31, 2022
@pajlada
Copy link
Member

pajlada commented Aug 31, 2022

As this issue is related to pajbot2, I've moved this issue to the pajbot2 repo.
If you want to talk about pajbot1 docker support feel free to open a new issue in the pajbot/pajbot repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants