Skip to content

A Debian based docker image that includes ASP.NET Core 5.0, nginx and the brotli compression module.

License

Notifications You must be signed in to change notification settings

whyvra/dotnet-nginx-brotli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-nginx-brotli

GitHub Build Docker Pulls LICENSE PRs Welcome

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.

Usage

To pull the image to your local instance, run:

docker pull whyvra/dotnet-nginx-brotli

Structure

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.

License

Released under the MIT License.

About

A Debian based docker image that includes ASP.NET Core 5.0, nginx and the brotli compression module.

Topics

Resources

License

Stars

Watchers

Forks

Packages