https://github.com/hostwithquantum/hugo-docker
hugo (extended) and Golang, in a Docker image
https://github.com/hostwithquantum/hugo-docker
docker docker-image go-modules gohugo golang hugo
Last synced: 2 months ago
JSON representation
hugo (extended) and Golang, in a Docker image
- Host: GitHub
- URL: https://github.com/hostwithquantum/hugo-docker
- Owner: hostwithquantum
- License: apache-2.0
- Created: 2023-11-24T15:45:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-24T09:51:07.000Z (4 months ago)
- Last Synced: 2024-12-30T21:15:55.651Z (4 months ago)
- Topics: docker, docker-image, go-modules, gohugo, golang, hugo
- Language: Dockerfile
- Homepage:
- Size: 220 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hugo-docker
A Docker/OCI image to include hugo (extended) and Golang (for hugo-modules).

## How to use
```sh
$ docker run --rm ghcr.io/hostwithquantum/hugo-docker:latest version
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended linux/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
```### Registries
The Image is pushed to multiple registries:
- [`ghcr.io/hostwithquantum/hugo-docker`](https://github.com/hostwithquantum/hugo-docker/pkgs/container/hugo-docker)
- [`docker.io/runwaypaas/hugo-docker`](https://hub.docker.com/r/runwaypaas/hugo-docker)## Build base for your website
Incorporate into your own image:
```Dockerfile
# get a specific tag to avoid potential breaks
FROM ghcr.io/hostwithquantum/hugo-docker:latest as hugoWORKDIR /website
ADD all-the-hugo-files .RUN hugo --source . --destination public --minify
FROM nginxinc/nginx-unprivileged:1.25.3 as prod
COPY --from=hugo /website/public /usr/share/nginx/html
```Build:
```sh
$ docker build -t mywebsite .
...
```Deploy/run:
```sh
$ docker run --rm -p 80:8080 mywebsite:latest
...
```Test: `open http://localhost/`