-
Notifications
You must be signed in to change notification settings - Fork 12
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
Configurable servers #485
base: main
Are you sure you want to change the base?
Configurable servers #485
Conversation
… environment variables, allow for configurable GeoServer, remove mentions of flyingpigeon in docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the combination of env-var and config overrides that you found to fix bird-house/birdhouse-deploy#14 would you recommend?
A sample docker run
showing different bind/host/port for certain results would be useful.
Dockerfile
Outdated
EXPOSE $RAVEN_BIND_PORT | ||
|
||
CMD ["gunicorn", "--bind=0.0.0.0:9099", "raven.wsgi:application"] | ||
CMD ["gunicorn", "--bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT", "raven.wsgi:application"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure $<env>
format does not work in CMD
.
Not sure about EXPOSE
.
The workaround is to use an entrypoint shell script, which then uses the variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One easy way to confirm env var works in CMD
and EXPOSE
is to build the docker image and test it in the PAVICS stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that and as I remembered, docker run raises something related to $RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT
being invalid because $RAVEN_BIND_PORT
doesn't get replaced by the provided integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given ENV RAVEN_BIND_PORT=${RAVEN_BIND_PORT:-9099}
, if we can make the launching command "see" the env var, it should work. So probably use ENTRYPOINT
instead of CMD
. If needed, force starting a new shell to "see" the env var with bash -c "gunicorn --bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT raven.wsgi:application"
.
Or research a recipe for how to properly start gunicorn inside a Docker image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool change, thanks. I simply would like to have backward compat with GEO_URL
and ensure the new Docker image works.
Dockerfile
Outdated
EXPOSE $RAVEN_BIND_PORT | ||
|
||
CMD ["gunicorn", "--bind=0.0.0.0:9099", "raven.wsgi:application"] | ||
CMD ["gunicorn", "--bind=$RAVEN_BIND_ADDRESS:$RAVEN_BIND_PORT", "raven.wsgi:application"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One easy way to confirm env var works in CMD
and EXPOSE
is to build the docker image and test it in the PAVICS stack.
# Conflicts: # Dockerfile # docs/source/dev_guide.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Overview
FYI @fmigneault
Changes:
Additional Information
Additional Information (2024-10)
I've opted to remove the Docker-based port overrides, as I was never able to get this to work (even with ENTRYPOINTS). I think that if we were to do this, it should be coordinated and cover the scope of all Birdhouse services at the same time.
Meanwhile, the other features in here (like having a more configurable GeoServer URL) are useful/valuable.