Sapphire not initializing correctly inside of Docker
I have a bot that works just fine when running outside of Docker, and although my Docker container starts, it does not initialize Sapphire correctly (although the ready event does fire)
Outside of Docker:
Inside Docker (same token and environment variables):
Solution:Jump to solution
i fixed this by doing
```dockerfile
WORKDIR /usr/src/app/services/bot/build
...
9 Replies
I'm using my own Dockerfile (and using /common/deploy because rush monorepo)
i looked at examples of sapphire with docker and docker-compose and i don't think im missing anything
(node_modules are already linked with pnpm inside /common/deploy, that's just how rush works)
Solution
i fixed this by doing
instead of
i do not know why this magically works but it does
Big red warning block: https://www.sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire
Folder matters..
Sapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and
yeah, but my "main" in package.json is set correctly and outside of docker I can be in whatever folder I want to run the bot
Outside of docker you probably also use something like
npm run start
I assume...?sometimes, but i also tried with just raw
node
in different folders
as long as it works now ¯\_(ツ)_/¯Well anyway point being the cwd matters
alr