A Debian based docker image that includes ASP.NET Core 5.0, nginx and the brotli compression module.
This image is intended to host a .NET Web API along with a static frontend like Angular or Blazor.
To pull the image to your local instance, run:
docker pull whyvra/dotnet-nginx-brotli
A non-root user and group called wwwdata
has already been created. Both its ID are 1000. Permissions on nginx folders have already been adjusted so that wwwdata
may run nginx.
Two folders have been created under /srv
, where you can add your .NET DLLs and your static frontend respectively.
/srv
├── dotnet/
├── www/
Nginx is configured to load hosts configuration from the /etc/nginx/conf.d
directory so you should place your conf file there. The brotli module will be loaded on startup. Use the brotli_static
and brotli_filter
directives.
gettext
has also been installed in case you may need to perform a config transformation with environment variables (for example to support SSL).
You can use the following command:
envsubst < path/to/tmpl | sed -e 's/@/$/g' > /etc/nginx/conf.d/tunnel.conf
Please note the sed
, as envsubst will evaluate all expressions start with $
, you need to use a placeholder for all symbols which should be $
. Here, @
are being used instead of $
and the sed
command will replace all @
with a $
after the envsubst
command.
Released under the MIT License.