Skip to content

Custom Docker image for nginx. Uses common configuration file for Javascript projects. Useful for Angular, React or any other precompiled app that needs nginx & gzip out of the box

Notifications You must be signed in to change notification settings

prosmartxyz/nginx-custom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-custom Image

Custom Docker image for nginx. Uses common configuration file for Javascript projects. Useful for Angular, React or any other precompiled app that needs nginx & gzip out of the box.

Gzip & Default Location

Configuration file comes with Gzip enabled for almost all modern browsers.

Default Location it's pretty useful for JavaScript applications. Enables the app to use direct links such as:

http://your-app-address/some/route/page

If Default Location to index.html is not configured, this route would not work because the router handler it's no intialized. With this configuration, route is passed to the JavaScript app and the router handler can redirect to the proper page/component.

Using in your Dockerfile

To use this in your Docker workflow (multi-staged or not), you can do it like this:

FROM prosmartxyz/nginx:latest
COPY dist/my-app /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]

Assuming that your built bundle is in dist/my-app, wich is the common scenario for almost every CLI over there. Please feel free to suggest changes or improvements.

About

Custom Docker image for nginx. Uses common configuration file for Javascript projects. Useful for Angular, React or any other precompiled app that needs nginx & gzip out of the box

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published