Skip to content
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 compose - cant change port and not running on 0.0.0.0 #104

Open
vultux opened this issue Jan 21, 2025 · 3 comments
Open

docker compose - cant change port and not running on 0.0.0.0 #104

vultux opened this issue Jan 21, 2025 · 3 comments

Comments

@vultux
Copy link

vultux commented Jan 21, 2025

Hi

I follow the guide from this page: Quick Start to configure docker compose.

I only disabled the proxy (because I use nginx reverse proxy and disable cron too), I changed the port in .env as indicated on the page, but it doesn't matter, the container always opens on localhost:8080

Any tips?

.env
TAG=15-slim OPENPROJECT_HTTPS=false OPENPROJECT_HOST__NAME=0.0.0.0 PORT=8084 OPENPROJECT_RAILS__RELATIVE__URL__ROOT= IMAP_ENABLED=false DATABASE_URL=postgres://postgres:Senha@2025@db/openproject?pool=20&encoding=unicode&reconnect=true RAILS_MIN_THREADS=4 RAILS_MAX_THREADS=16 PGDATA="./pgdata" OPDATA="./assets"

@Salmonllama
Copy link

Salmonllama commented Jan 22, 2025

I've been experiencing something similar as well.

Trying to set up open project via docker compose according to the quick start linked above. We have this running in a headless linux server, so navigating to localhost isn't exactly something we can do.

I have been unable to access Open Project from outside of the server, tried on our LAN with IP and a local domain name. I have also attempted to use our Caddy reverse proxy with Let's Encrypt, and the built-in proxy disabled. Every time we get a response status 400: invalid host_name configuration.

@vultux I did some digging in the end configs for docker containers, the PORT value in .env controls the host port that the built-in proxy container listens on. You can see this in docker-compose.yml where it sets the host port to the environment variable, or 8080 if not set. This is verified when I look at docker inspect openproject-proxy-1, where 80/tcp binds to "HostPort": "8080"

OPENPROJECT_HOST__NAME is a different story, however. Whatever that's set to in .env doesn't matter and isn't reflected at all in the end config. Despite this line of the compose file, OPENPROJECT_HOST__NAME appears to be set to localhost without the port.

--

All below configs are pulled from a clean environment following only the steps in the quick start

.env has been changed to disable bind mounts (I prefer named volumes) and set OPENPROJECT_HOST__NAME=project.<domain>.org (local DNS address that points to the LAN IP address, no TLS set up yet)

output of docker inspect openproject-web-1
https://gist.github.com/Salmonllama/630c009ece994c3208e9665caf0ff1f7#file-inspect-txt-L212

Not really sure where to go with this, but I'm going to keep poking around, see what I can make of it.

@Salmonllama
Copy link

Update: Commenting out L17 of docker-compose.yml has made open project available via ip (192.168.1.75:8080), but gives an SSL error when access via hostname (project..org:8080) which is a locally resolved name that points to 192.168.1.75.

Changing the value of OPENPROJECT_HOST__NAME in that same line in the compose file directly to project.<domain>.org results in an SSL error when accessing the app via hostname, (back to invalid host_name configuration via IP though) although it is redirecting to https://. I retried this with OPENPROJECT_HTTPS and OPENPROJECT_HSTS set to false via docker-compose.yml, and saw the same result.

It is worth noting, however, that setting the environment variables directly in docker-compose.yml saw them change properly in the docker container config.

In poking around though, I did find this which indicates that host_name validation is done via the OPENPROJECT_RAILS__RELATIVE__URL__ROOT environment variable. I'm going to try setting that one tomorrow and see what happens.

@vultux
Copy link
Author

vultux commented Jan 27, 2025

Hi Salmonllama

I gave up and just installed it straight into a VM, using NGINX Reverse Proxy to handle SSL.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants