Skip to content

Database port changeable via DB_PORT env variable #197

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

Closed
wants to merge 1 commit into from
Closed

Database port changeable via DB_PORT env variable #197

wants to merge 1 commit into from

Conversation

dionysiusmarquis
Copy link

Hey,

I needed to change the database port and this changes will make it possible :)

fixes #196

@ssddanbrown
Copy link
Member

Hi @dionysiusmarquis,
Thanks for raising this issue.

The database port can currently be set by specifying it on the DB_HOST env variable, For example:

# Connect to database locally on port 6060
DB_HOST=127.0.0.1:6060

@dionysiusmarquis
Copy link
Author

In my special case I wanted to use it with https://hub.docker.com/r/solidnerd/bookstack/ and the whole docker start routine got messed up with the host:port approach. The laravel port option was the only one working for me in this scenario.

@dionysiusmarquis
Copy link
Author

The latest changes for https://hub.docker.com/r/solidnerd/bookstack/ (solidnerd/docker-bookstack#6) depending on this pull request. Any chance to get it merged?

@ssddanbrown
Copy link
Member

@dionysiusmarquis Yeah but I just want to test why using host:port was breaking on docker first. Also, once merged, it will be a small while before the next release is put together anyway.

This pull request could also break the configuration of existing setups so I need to test that out to find any consequences.

@dionysiusmarquis
Copy link
Author

It doesn't work because the shell script waits for the database using ${DB_HOST}:${DB_PORT}. If DB_HOST is 127.0.0.1:6060 it would end up with 127.0.0.1:6060:3306. https://github.com/solidnerd/docker-bookstack/blob/master/docker-entrypoint.sh#L87

@ssddanbrown
Copy link
Member

Hi @dionysiusmarquis,
From looking at the issue here I don't think a new .env variable needs to be made available and no changes are needed to the BookStack core code. This issue is really only specific to the docker script and how it handles the environment variables.

I'll take a look at updating the docker entrypoint script.

@ssddanbrown
Copy link
Member

Since solidnerd/docker-bookstack#9 has now been merged and made it into a release this is no longer required as the port can be defined via the host and is now compatible via the docker solution.

@ssddanbrown ssddanbrown closed this Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Database port env variable
2 participants