refactor: only extract the nginx.conf.sigil from the source code and not an app path
The previous method was a bit more difficult for users to interact with as they needed to ensure the file was at a certain path in the built image. This change divorces the file from the built artifact, better aligning the nginx.conf.sigil handling with the rest of Dokku's monorepo support. A side effect of this is now building proxy configurations does not require access to the built image. Closes #5207
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
- The output of `run:detached` now uses the container name - eg. `node-js-app.run.1` - vs the container id.
|
||||
- The ID of `cron` tasks is now base36-encoded instead of base64-encoded.
|
||||
- The `nginx.conf.sigil` is now extracted when source code is extracted for a build and not from the built image. Users can specify alternative paths via the `nginx-conf-sigil-path` property of the `nginx` plugin. See the [nginx documentation](/docs/networking/proxies/nginx.md#customizing-the-nginx-configuration) for more information on how to configure the `nginx.conf.sigil` path for your application.
|
||||
|
||||
## Removals
|
||||
|
||||
|
||||
@@ -287,15 +287,26 @@ dokku nginx:validate-config node-js-app --clean
|
||||
|
||||
> New as of 0.5.0
|
||||
|
||||
Dokku uses a templating library by the name of [sigil](https://github.com/gliderlabs/sigil) to generate nginx configuration for each app. You may also provide a custom template for your application as follows:
|
||||
Dokku uses a templating library by the name of [sigil](https://github.com/gliderlabs/sigil) to generate nginx configuration for each app. This may be overriden by committing the [default configuration template](https://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/nginx.conf.sigil) to a file named `nginx.conf.sigil` in the root of the app repository.
|
||||
|
||||
- Copy the [default configuration template](https://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/nginx.conf.sigil) to a file named `nginx.conf.sigil` and either:
|
||||
- If using a buildpack application, you __must__ check it into the root of your app repo.
|
||||
- If using a dockerfile or docker image for deploys, either:
|
||||
- If `WORKDIR` is specified, add the file to the `WORKDIR` specified in the last Dockerfile stage (example: `WORKDIR /app` and `ADD nginx.conf.sigil /app`).
|
||||
- If no `WORKDIR` is specified, add the file to the root (`/`) of the docker image (example: `ADD nginx.conf.sigil /`).
|
||||
By default, the `nginx.conf.sigil` path is pulled from the root of the app source code repository. To change the path from which the `nginx.conf.sigil` is extracted, the `nginx-conf-sigil-path` property can be modified via `nginx:set`.
|
||||
|
||||
> When using a custom `nginx.conf.sigil` file, depending upon your application configuration, you _may_ be exposing the file externally. As this file is extracted before the container is run, you can, safely delete it in a custom `entrypoint.sh` configured in a Dockerfile `ENTRYPOINT`.
|
||||
```shell
|
||||
dokku nginx:set node-js-app nginx-conf-sigil-path dokku/nginx.conf.sigil
|
||||
```
|
||||
|
||||
This property can also be changed globally, which will take into effect if there is no value at the app level.
|
||||
|
||||
```shell
|
||||
dokku nginx:set --global nginx-conf-sigil-path dokku/nginx.conf.sigil
|
||||
```
|
||||
|
||||
In either case, the value can be reset by specifying an empty value.
|
||||
|
||||
```shell
|
||||
dokku nginx:set node-js-app nginx-conf-sigil-path
|
||||
dokku nginx:set --global nginx-conf-sigil-path
|
||||
```
|
||||
|
||||
> The [default template](https://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/nginx.conf.sigil) may change with new releases of Dokku. Please refer to the appropriate template file version for your Dokku version, and make sure to look out for changes when you upgrade.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user