Turn your Angular project into a docker image runing NGINX to serve your site with render-tron prerendering enabled for search engines.
Kamla junior
This package creates an NGINX based Docker container serving a SPA App with prerendering powered by the public RENDERTRON server(you can change that of course) and some basic caching settings.
You can use npm
npm install spa-dockerizer
Doing so should create a Dockerfile
and a .dockerignore
at the root of your project, feel free to edit the .dockerignore
to fit the Docker context you want to send, the NGINX server has some basic caching settings and the public Rendertron server as prerenderer but you can also edit the Dockerfile
to fine-tune them.
If you don't feel like using npm, just download the zip tarball from this page, unzip it and copy the Dockerfile
and .dockerignore
into the root of your project, then edit them at your convenience.
build the docker image
docker build -t my-spa-app-image --build-arg BUILD_OUTPUT=/path/to/build/output .
Run the image locally to test your site
docker run -p 8080:80 -d my-spa-app-image
Then visit localhost:8080
from your browser to make sure it works.
Push it to any registry for deployment
80
The Spa-Dockerizer is an open-source software licensed under the MIT license.
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.