feature(docker-image): allow custom nginx port within container (#4086)
* Use PORT to override nginx listen port when defined * Add dockerignore to make build context smaller
This commit is contained in:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/.git
|
||||||
|
/.github
|
||||||
|
/dev-helpers
|
||||||
|
/docs
|
||||||
|
/src
|
||||||
|
/swagger-ui-dist-package
|
||||||
|
/test
|
||||||
@@ -12,7 +12,7 @@ ENV OAUTH_REALM "**None**"
|
|||||||
ENV OAUTH_APP_NAME "**None**"
|
ENV OAUTH_APP_NAME "**None**"
|
||||||
ENV OAUTH_ADDITIONAL_PARAMS "**None**"
|
ENV OAUTH_ADDITIONAL_PARAMS "**None**"
|
||||||
ENV SWAGGER_JSON "/app/swagger.json"
|
ENV SWAGGER_JSON "/app/swagger.json"
|
||||||
ENV PORT 80
|
ENV PORT 8080
|
||||||
ENV BASE_URL ""
|
ENV BASE_URL ""
|
||||||
|
|
||||||
RUN apk add --update nginx
|
RUN apk add --update nginx
|
||||||
|
|||||||
@@ -53,4 +53,7 @@ if [[ -n "$VALIDATOR_URL" ]]; then
|
|||||||
unset TMP_VU
|
unset TMP_VU
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# replace the PORT that nginx listens on if supplied
|
||||||
|
if [[ -n "${PORT}" ]]; then sed -i "s|8080|${PORT}|g" /etc/nginx/nginx.conf; fi
|
||||||
|
|
||||||
exec nginx -g 'daemon off;'
|
exec nginx -g 'daemon off;'
|
||||||
|
|||||||
Reference in New Issue
Block a user