curtisf / logger

Loggerbot version 3, the Discord bot serving nearly 24 million users.
https://logger.bot
GNU General Public License v3.0
379 stars 134 forks source link

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

Open uchihaservice opened 8 months ago

uchihaservice commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

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

SUPERCHIEFYT commented 8 months ago

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

CillyCil commented 8 months ago

Ah, sorry about that

JasmeowTheCat commented 7 months ago

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 commented 7 months ago

@JasmeowTheCat

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

JasmeowTheCat commented 7 months ago

@Elara-Discord-Bots

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 commented 7 months ago

@JasmeowTheCat

DrMemoryFish commented 5 months ago
  • 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 commented 5 months ago

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