idio-sync / romm-comm

RomM-ComM (RomM Communicator Module) - Discord bot that interfaces with Romm API
12 stars 1 forks source link

Docker Issues. #8

Closed Salpertio closed 5 hours ago

idio-sync commented 6 hours ago

What issue are you having with the docker image?

Salpertio commented 6 hours ago

What issue are you having with the docker image?

apologies clicked comment to quickly.

trying to get the container running in unraid (which is not something you officially support) so i moved to directly trying to get romm_comm working in docker directly.

docker run -d \ --name romm_comm \ --network bridge \ -v /mnt/user/appdata/romm_comm/.env:/app/.env \ -v /mnt/user/appdata/romm_comm/data:/app/data \ idiosync000/romm-comm:latest

when i do this the container immediately fails so i needed to dig deeper.

`docker run -it \ --name romm_comm \ --network bridge \ -v /mnt/user/appdata/romm_comm/.env:/app/.env \ -v /mnt/user/appdata/romm_comm/data:/app/data \ idiosync000/romm-comm:latest bash Unable to find image 'idiosync000/romm-comm:latest' locally latest: Pulling from idiosync000/romm-comm 302e3ee49805: Already exists 030d7bdc20a6: Pull complete a3f1dfe736c5: Pull complete 3971691a3637: Pull complete fea27c652e42: Pull complete 36988d14ed42: Pull complete 970894adec03: Pull complete Digest: sha256:bf86c463d5b381cebcba20fd9d94107297ca643924181c7e71ba0d447c8edf7a Status: Downloaded newer image for idiosync000/romm-comm:latest

root@5e884ad27618:/app# cat /app/.env/.env

Required Settings

TOKEN= GUILD_ID= API_BASE_URL=http://192.168.1.68:6924/api # Base API URL, not /platforms USER=testuser PASS=

Optional Settings

DOMAIN= SYNC_RATE=3600 REQUESTS_ENABLED=TRUE ENABLE_USER_MANAGER=TRUE AUTO_REGISTER_ROLE_ID=romm UPDATE_VOICE_NAMES=true CHANNEL_ID= SHOW_API_SUCCESS=TRUE CACHE_TTL=300 API_TIMEOUT=10

so this should run now right?

root@5e884ad27618:/app# python3 bot.py 2024-11-16 17:44:30,769 - discord.client - WARNING - PyNaCl is not installed, voice will NOT be supported 2024-11-16 17:44:30,769 - romm_bot - ERROR - Error running bot: Traceback (most recent call last): File "bot.py", line 445, in asyncio.run(main()) File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "bot.py", line 434, in main bot = RommBot() File "bot.py", line 117, in init self.config = Config() File "bot.py", line 84, in init self.validate() File "bot.py", line 92, in validate raise ValueError(f"Missing required environment variables: {', '.join(missing)}") ValueError: Missing required environment variables: TOKEN, GUILD_ID, API_BASE_URL, USER, PASS root@5e884ad27618:/app#`

idio-sync commented 6 hours ago

You're in luck, because I actually daily drive UnRaid and that's what I've mostly been testing the container with. I don't have the .env passed through, I just define the variables directly in UnRaid since that takes precedence. These are the settings I have filled out and I can confirm the bot works fine this way.

Unraid

Salpertio commented 6 hours ago

WOWZERS. okay.

ill try this and follow up.

idio-sync commented 6 hours ago

WOWZERS. okay.

ill try this and follow up.

I grabbed the container through the Community Apps Dockerhub integration. If you search for it, nothing will show up in the actual app directory but on the right there's a link to continue the search on Dockerhub. Do that and you'll find it. You have to add the variables manually, but it's quick through the gui.

Salpertio commented 5 hours ago

i went to search for the template in dockerhub under romm-comm.

i had GUILD_ID AND API_BASE_URL after adding the rest of the variables, changing those two according to the SS and removing the /api i had. it works.

thanks for the help.