Skip to content

Commit 45ab451

Browse files
author
doublebyte1
committed
- Ensure docker container is reading port from conf file
1 parent 4fba2a4 commit 45ab451

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docker/entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ pygeoapi openapi generate ${PYGEOAPI_CONFIG} --output-file ${PYGEOAPI_OPENAPI}
6969

7070
echo "openapi.yml generated continue to pygeoapi"
7171

72+
apt-get update
73+
apt-get install wget -y && \
74+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq &&\
75+
chmod +x /usr/local/bin/yq
76+
77+
echo "Evaluating gunicorn port from configuration"
78+
79+
PORT="$(yq eval '.server.bind.port' ${PYGEOAPI_CONFIG})"
80+
81+
if [ -n "$PORT" ]; then
82+
CONTAINER_PORT=$PORT
83+
fi
84+
85+
echo "Guincorn port set to ${CONTAINER_PORT}"
86+
7287
start_gunicorn() {
7388
# SCRIPT_NAME should not have value '/'
7489
[[ "${SCRIPT_NAME}" = '/' ]] && export SCRIPT_NAME="" && echo "make SCRIPT_NAME empty from /"

0 commit comments

Comments
 (0)