-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
🐋 refactor(docker-compose): use "HOST" in ports
field
#2654
Conversation
Sorry this took so much of your time,I've been meaning to implement this and lost track: #2374 Can you read the discussion there? I believe it will still achieve what you want, as $(HOST} may expose the container unecessarily |
I use
but alway get this error when starting
|
|
I can’t believe a guy came up with an exact same solution as I did a month earlier. And as ${HOST} is set to localhost in default .env file, I believe this will stop the exposure of container but not expose it unnecessarily (for now it always expose container to 0.0.0.0). |
ports
field
Having an issue with no configuration changed after merging this, which is not ideal, so I reverted the commit: 4ffc141 Having the issue: 1 error(s) decoding:
* 'services[api].ports[0]' expected a map, got 'string' even with HOST and PORT defined in the env file. For those needing this change, I recommend using your own compose file or simply committing this change on your fork. |
Where did this error come up? As I've tested, docker compose works well. |
The only problem I've met is when HOST is set to localhost:
And I think if we don't fix this, ppl using docker would be really confused if they want to change host. |
@nidasfly would it make sense to remove the HOST definition in the compose file? |
But any way setting this port proxy is working fine, this ${HOST} will be binded to the HOST in .env file. |
…y-avila#2654)" This reverts commit df6183d.
Summary
I've wasting hours figuring how to expose my librechat to localhost only, while I am using docker compose. No matter what I changed the "HOST" in .env file to doesn't made any change, the port was always exposed to 0.0.0.0:PORT.
Then I found out that the variable "HOST" is missed in the docker-compose.yml file (which users should not change!). After adding the variable to the port column, everything works perfect. The docker will expose librechat to any IP that is set as HOST in .evn file.
Change Type
Testing
Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.
Checklist