SPA Dockerizer

0

0

Kamla junior

Added on December 21, 2024

Turn your Angular project into a docker image runing NGINX to serve your site with render-tron prerendering enabled for search engines.

SPA Dockerizer

Turn your Angular project into a docker image runing NGINX to serve your site with render-tron prerendering enabled for search engines.

Kamla junior

readme.md

Description

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.

How to use ?

1. Install

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.

2. Build the image

build the docker image

docker build -t my-spa-app-image --build-arg BUILD_OUTPUT=/path/to/build/output .

3. Run it locally

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.

4. Push

Push it to any registry for deployment

5. Notes

  • The container exposes port 80
  • You can change the prerenderer by editing the Dockerfile and providing another Rendertron instance url.

License

The Spa-Dockerizer is an open-source software licensed under the MIT license.

Related Content

JSCutlery Test Utils

Tools that make testing cheaper, including Cypress Mount which brings Angular support to Cypress Component Testing
GitHubUpdated today

BookCart

An e-commerce application for an online book store created with ASP.NET Core 5.0 and Angular 11, using SQL Server as database.
GitHubUpdated 30 days ago

lumberjack

Lumberjack is a versatile Angular logging library, specifically designed to be extended and customized. It provides a few simple log drivers (logging mechanisms, transports, log drivers) out-of-the-box. It's easy to enable the built-in log drivers or create and use custom log drivers.
GitHubUpdated 3 months ago

angular-cli-ghpages

Deploy your Angular app to GitHub pages directly from the Angular CLI! 🚀
GitHubUpdated 4 months ago

Observable Store

Observable Store is a front-end state management library that provides a simple yet powerful way to manage state in front-end applications such as Angular, React, or Vue. Front-end state management has become so complex that many of us spend more hours working on the state management code than on the rest of the application. Observable Store has one overall goal - keep it simple.
GitHubUpdated 19 months ago

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.