Skip to content

A Simple nginx based docker image used to deploy spa sites

Notifications You must be signed in to change notification settings

ets-einer/einer-spa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker pull danihre/spa-nginx

This is a Docker image used to serve a Single Page App (pure frontend javascript) using nginx, it support PushState, and includes a way to pass configuration at run time.

Supported tags and Dockerfile links

App Setup

This docker image is built for index.html file being in the /app directory. pushState is enabled.

At a minimum, you will want this in your Dockerfile:

FROM danihre/spa-nginx

COPY build/ /app
COPY index.html /app/index.html

Then you can build & run your app in the docker container. It will be served by a nginx static server.

$ docker build -t your-app-image .
$ docker run -p 8000:80 your-app-image

You can then go to http://docker-ip:8000/ to see it in action.

This will create a config.js file, which you can then add to your index.html, or load asynchronously. The path can be controlled with CONFIG_FILE_PATH environmental variable.

About

A Simple nginx based docker image used to deploy spa sites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published