-
Notifications
You must be signed in to change notification settings - Fork 14
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
Docker noob here, help? -- could not read file "srh-config/tokens.json": #26
Comments
You shouldn't need a tokens.json file -- the env command will work just fine. Not to worry though -- there is an easy fix for this. Assuming you are using Windows or Mac, you can use
This will automatically resolve to your parent system's private IP, and should do the trick! |
So fast to answer. Thanks a lot. I am actually on Linux Ubuntu. When I try to run this command, or the command listed in the readme, I get this: sudo docker run \ 10:39:14
-it -d -p 8080:80 --name srh \
-e SRH_MODE=env \
-e SRH_TOKEN=your_token_here \
-e SRH_CONNECTION_STRING="redis://host.docker.internal:6379" \
hiett/serverless-redis-http:latest
docker: Error response from daemon: Conflict. The container name "/srh" is already in use by container "6b44fb4700db981572d6995e2ec3253427667e3961542af66af27f9dbf8b89a1". You have to remove (or rename) that container to be able to reuse that name. However, |
This is because the the container is likely stopped in the background, but not removed. you can run Linux is a bit different -- you might have issues with host.docker.internal. That is a feature of Docker Desktop specifically, not built into the normal Docker engine. You can use the static IP |
(for reference, |
Thanks so much @hiett. I didn't know about sudo docker run \
-it -d -p 8080:80 --name srh \
-e SRH_MODE=env \
-e SRH_TOKEN=your_token_here \
-e SRH_CONNECTION_STRING="redis://172.17.0.1:6379" \
hiett/serverless-redis-http:latest I managed to connect to the SRH server from my Next.JS local instance, but still it cannot connect to the redis server running on the parent machine. Maybe after I manage to do it, we can have a tutorial settings on README for linux? Just a suggestion |
Maybe would it work if I ran redis inside the container? So that the connection wouldn't need to leave it... |
There is a docker compose example in the readme that will work out-of-the-box on any operating system: https://github.com/hiett/serverless-redis-http?tab=readme-ov-file#via-docker-compose This is the recommended way to run, and a lot easier (because you can stop and start redis & srh at the same time!) Closing this issue because it's general docker issues rather than anything specific with SRH |
Hey, thanks so much! Much better to use docker-compose. Definitely need to use and feel more confident with docker. Thanks for creating this repo! |
I understand this is just some configuration I haven't done correctly on my part :P
First, I ran this and worked perfectly. SRH server was up:
sudo docker run \ -it -d -p 8080:80 --name srh \ -e SRH_MODE=env \ -e SRH_TOKEN=your_token_here \ -e SRH_CONNECTION_STRING="redis://localhost:6379" \ hiett/serverless-redis-http:latest
But, for some reason the SRH server couldn't reach my redis instance running on 127.0.0.1:6379. I thought that maybe changing the connection_string to 127.0.0.1 instead of localhost would fix it. I then killed my running container and tried running the command / image again. But no luck.
Is there a way to configure the server? I'm guessing I need to create this tokens.json but I don't know how.
The text was updated successfully, but these errors were encountered: