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

[Tutorial] Running on Docker with Docker-Compose #43

Open
uchihaservice opened this issue Mar 19, 2024 · 12 comments
Open

[Tutorial] Running on Docker with Docker-Compose #43

uchihaservice opened this issue Mar 19, 2024 · 12 comments

Comments

@uchihaservice
Copy link

uchihaservice commented Mar 19, 2024

Hey everyone,

Here is a docker compose file.

The bot works perfectly with it. If you want to set it up quickly.

Please create the following folders
logger
bezerk

Clone logger to /logger/
Clone bezerk to /bezerz/.

After that you can run docker-compose up -d without any problems.
Run node src/miscellaneous/generateDB.js before the first start & adjust the .env.

version: "2"
services:
  cache:
    image: redis:6.2-alpine
    restart: always
    command: redis-server --save 20 1 --loglevel warning
    volumes: 
      - ./cache:/data
  node:
    image: "node:18"
    user: "node"
    working_dir: /home/node/app
    environment:
      - NODE_ENV=production
    volumes:
      - ./logger:/home/node/app
    command: "node index.js"
    depends_on:
      - cache
      - node2
      - db
  node2:
    image: "node:18"
    user: "node"
    working_dir: /home/node/app
    environment:
      - NODE_ENV=production
    volumes:
      - ./bezerk:/home/node/app
    command: "node index.js"
  db:
    image: postgres
    restart: always
    shm_size: 128mb
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: "YOurPassWoRd"
@JasmeowTheCat
Copy link

Sorry to state the obvious - What do you mean by "Bezerk" - I am not fully aware of Github so trying to look where that is.

@uchihaservice
Copy link
Author

Sorry to state the obvious - What do you mean by "Bezerk" - I am not fully aware of Github so trying to look where that is.

Look at the .env.example
Bezerk is following: https://github.com/thesharks/bezerk
To run the logger you need that.

@SUPERCHIEFYT
Copy link
Contributor

@uchihaservice to run logger you don't need bezerk, just remove BEZERK_URI and BEZERK_SECRET from the .env file

AFAIK bezerk is only needed for the main Logger / Patron Logger bots, not the selfhosted bots.

If I'm wrong about that then piero can clear it up.

@CillyCil
Copy link

CillyCil commented Apr 7, 2024

Do you have slash commands? I used the docker setup and only have text commands.

@SUPERCHIEFYT
Copy link
Contributor

@minecrafterty1 did you use <prefix>setcmd global? (after you use that command restart Discord)

@CillyCil
Copy link

CillyCil commented Apr 7, 2024

Ah, sorry about that

@JasmeowTheCat
Copy link

JasmeowTheCat commented Apr 24, 2024

What sentry URI do I provide it? I've installed Sentry as a docker container, so I just need to give it a URI. I am bit confused what it wants in the env field for RAVEN_URI=

The next question I have is - How do we get the bot dashboard up? I can expose that which isn't difficult, I just need to know what port or configuration I need to do to allow me to view it.

With Bezerk also, I run into the issue with it stating "Error: Cannot find module 'dotenv'" as obviously it needs to NPM I first, but sadly running that as an additional command inside the container will just throw access denied error.

@Elara-Discord-Bots
Copy link

Elara-Discord-Bots commented Apr 24, 2024

@JasmeowTheCat

  • RAVEN_URI= just remove or leave blank.
  • There is no bot dashboard for the development or selfhost branches. There is only a dashboard for the exe branch / version. (exe is outdated)
  • Bezerk isn't needed.

Also for Docker, try to use the selfhost branch on the repo, Curtis/Piero added Docker support in that branch.

@JasmeowTheCat
Copy link

@Elara-Discord-Bots

  • Appreciated, but I would like to get the RavenURI working as it complains it would only log messages when I need to log other things.
  • Sad to hear there's no bot dashboard, not to worry though, I can use the slash commands.
  • What does Bezerk do? I thought that was the dashboard hence trying to make it work.

Regarding the patreon additions that existed with this bot, hopefully we can have someone make a pull request or Ill pay for it honestly so they can add the features that are missing.

@Elara-Discord-Bots
Copy link

@JasmeowTheCat

  • When RAVEN_URI isn't added it will still log stuff to the console (and to the DISCORD_WEBHOOK_URL)
  • Bezerk is a backend service to fetch info for the dashboard and anything else that needs to get data from any of the bot's shards.
  • And if you're looking for file/attachment logs you could try Tizzy's fork that has it.

@DrMemoryFish
Copy link

  • Bezerk

I'm not sure how to get Bezerk working. The link here is telling me, "The owner has archived this repository on Dec 2, 2019. It is now read-only.".

I don't know what I'm supposed to do here. Can you help me, please?
Thank you.

@Elara-Discord-Bots
Copy link

@DrMemoryFish Bezerk isn't needed for selfhosting users, just leave the .env fields blank

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

No branches or pull requests

6 participants