Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lbenie/docker-nogo
Docker image for hugo static page generator with nodejs for dependency management and openssh to transfer file via scp/rsync (https://gohugo.io) (https://nodejs.org)
https://github.com/lbenie/docker-nogo
docker docker-compose hugo nginx nginx-proxy nginx-server nodejs rsync scp static-page static-pages static-site-generator toml
Last synced: 11 days ago
JSON representation
Docker image for hugo static page generator with nodejs for dependency management and openssh to transfer file via scp/rsync (https://gohugo.io) (https://nodejs.org)
- Host: GitHub
- URL: https://github.com/lbenie/docker-nogo
- Owner: lbenie
- License: mit
- Created: 2017-03-26T20:12:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T15:43:32.000Z (about 2 years ago)
- Last Synced: 2024-05-01T15:04:52.609Z (9 months ago)
- Topics: docker, docker-compose, hugo, nginx, nginx-proxy, nginx-server, nodejs, rsync, scp, static-page, static-pages, static-site-generator, toml
- Language: JavaScript
- Homepage:
- Size: 142 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lbenie/docker-nogo
[![Docker Build Statu](https://img.shields.io/docker/build/lucienb/docker-nogo.svg)]()
[![Docker Automated buil](https://img.shields.io/docker/automated/lucienb/docker-nogo.svg)]()
[![Docker Pulls](https://img.shields.io/docker/pulls/lucienb/docker-nogo.svg)]()
[![Docker Stars](https://img.shields.io/docker/stars/lucienb/docker-nogo.svg)]()`lbenie/docker-nogo` is a [Docker](https://www.docker.io) base image for static sites generated with [Hugo](http://gohugo.io).
Thanks to [publysher](https://github.com/publysher) for inspiring this image.
In contrary of his docker image, I've added [nodejs](https://nodejs.org/) to the image since I needed `npm` to build my projects dependencies with bitbucket pipelines.
Also it contains openssh for transfering files with scp/rsync over my production server.The build is relatively small at ~25MB.
## Prerequisites
The image is based on the following directory structure:
```
.
├── Dockerfile
├── docker-compose.yml
├── config.toml
├── content
│ └── ...
├── layouts
│ └── ...
└── static
└── ...
```
### Dockerfile```Docker
FROM lucienb/docker-nogo:latest
```## Building your site
Based on this structure, you can easily build an image for your site:
```sh
docker build -t my/image .
```
Your site is automatically generated during this build.## Using your site
Using this docker image together with nginx for serving static data.
`docker-compose.yml`
```Docker
hugo:
image: lucienb/docker-nogo:latest
volumes:
- .:/src
- ./output/:/output
environment:
- HUGO_REFRESH_TIME=90 # rebuilds the project every 90 seconds
- HUGO_THEME=mytheme
- HUGO_BASEURL=//localhost/
restart: always
web:
image: jojomi/nginx-static
volumes:
- ./output:/var/www
environment:
- VIRTUAL_HOST=localhost/
ports:
- "1313:80"
restart: always
```In your terminal run
```sh
docker-compose up
```and Voilà !
You can access your web server at `http://localhost:1313` served by nginx and updated every 90 seconds (HUGO_REFRESH_TIME=90)
Happy coding ;)