Просмотр исходного кода

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
bubble
David Muto 6 лет назад
committed by kyle
Родитель
Сommit
5b1dbec9b0
3 измененных файлов: 11 добавлений и 1 удалений
  1. +7
    -0
      .dockerignore
  2. +1
    -1
      Dockerfile
  3. +3
    -0
      docker-run.sh

+ 7
- 0
.dockerignore Просмотреть файл

@@ -0,0 +1,7 @@
/.git
/.github
/dev-helpers
/docs
/src
/swagger-ui-dist-package
/test

+ 1
- 1
Dockerfile Просмотреть файл

@@ -12,7 +12,7 @@ ENV OAUTH_REALM "**None**"
ENV OAUTH_APP_NAME "**None**"
ENV OAUTH_ADDITIONAL_PARAMS "**None**"
ENV SWAGGER_JSON "/app/swagger.json"
ENV PORT 80
ENV PORT 8080
ENV BASE_URL ""

RUN apk add --update nginx


+ 3
- 0
docker-run.sh Просмотреть файл

@@ -53,4 +53,7 @@ if [[ -n "$VALIDATOR_URL" ]]; then
unset TMP_VU
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;'

Загрузка…
Отмена
Сохранить