This is a reusable Docker image that allows to deploy static sites to Dokku with Dockerfile (and without using buildbacks). Runs an nginx web worker to serve your index.html site.
Originally based on IlyaSemenov/dokku-static-site and pahaz/dokku-static-site
Demo, hosted on GitHub Pages, since, you know, it is a static site after all.
Now using Heroku Static Buildpack
This means that your static site files are now in the /docs folder (can be changed in static.json
)
There are several options that allow you to host, proxy, and customise all sorts of static sites. Refer to the repository for more configuration options.
- Clone this repo
git clone https://github.com/shrmnk/dokku-static-site.git my-static-site
cd my-static-site
- Make changes to your site (by default, we have index.html and 404.html) and commit them
git add .
git commit -m "<Commit message>"
- Add dokku host as a git remote
git remote add dokku dokku@<dokku.host>:<app-name>
- Push to dokku
git push dokku master
- Remember to set your domains up if needed
dokku domains:add <app-name> <domain>
- (Optional) Change the origin
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
Add line to .dockerignore
if you want to exclude certain files from getting exposed.
Differences from pahaz/dokku-static-site
- Removed css files and replaced with cdnjs resources where available
- Removed full-blown bootstrap theme
- Removed brand-specific text and example
- Fixed 404 page not rendering
- Uses Heroku Static Buildpack