mirror of
https://github.com/gomods/athens
synced 2026-02-03 14:20:31 +00:00
Add Dockerfile for docs (#857)
There's no official image for hugo, so lets make our own and have the Makefile build the Dockerfile Add some basic documentation I've added some simple documentation and tidied up the Dockerfile. I move the file to use best practice and reduced the size slightly. Personally I don't think we'll need to alter the address and not watch files as it's only going to be used for local development atm. It might be useful in future to move to being able to alter these if we're using this in production Don't use docs use hugo It would be confusing for people to docker pull the docs but not have any docs included in them. hugo as the name would make way more sense. Don't lock down to digest We should trust official libs, especially the alpine build. Signed-off-by: Chris M <millscj01@gmail.com>
This commit is contained in:
committed by
Marwan Sulaiman
parent
6a005988dc
commit
50876fbf79
@@ -71,3 +71,16 @@ then you can run the unit tests:
|
||||
```console
|
||||
make test-unit
|
||||
```
|
||||
|
||||
# Run the docs
|
||||
|
||||
To get started with developing the docs we provide a docker image which you can use from within the `/docs` directory. It should work on all platforms. To get it up and running:
|
||||
|
||||
```
|
||||
docker run -it --rm \
|
||||
--name hugo-server \
|
||||
-p 1313:1313 \
|
||||
-v $(PWD):/src:cached \
|
||||
gomods/hugo
|
||||
|
||||
```
|
||||
|
||||
@@ -8,7 +8,7 @@ run: build
|
||||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
cd docs && hugo
|
||||
docker build -t gomods/hugo -f docs/Dockerfile .
|
||||
|
||||
.PHONY: setup-dev-env
|
||||
setup-dev-env:
|
||||
@@ -54,7 +54,7 @@ alldeps:
|
||||
docker-compose -p athensdev up -d minio
|
||||
docker-compose -p athensdev up -d jaeger
|
||||
echo "sleeping for a bit to wait for the DB to come up"
|
||||
sleep 5
|
||||
sleep 5
|
||||
|
||||
.PHONY: dev
|
||||
dev:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
FROM alpine:3.8
|
||||
|
||||
ENV HUGO_VERSION=0.50
|
||||
ENV HUGO_BINARY=hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
|
||||
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp
|
||||
|
||||
RUN tar -xf /tmp/${HUGO_BINARY} -C /tmp \
|
||||
&& mv /tmp/hugo /usr/local/bin/hugo \
|
||||
&& rm -rf /tmp/hugo_${HUGO_VERSION}_linux_amd64 \
|
||||
&& rm -rf /tmp/${HUGO_BINARY} \
|
||||
&& rm -rf /tmp/LICENSE.md \
|
||||
&& rm -rf /tmp/README.md \
|
||||
&& apk upgrade --update \
|
||||
&& apk add --no-cache git asciidoctor libc6-compat libstdc++ ca-certificates
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
CMD ["hugo", "server", "-s", "/src", "-b", "http://localhost:1313", "--bind", "0.0.0.0"]
|
||||
|
||||
EXPOSE 1313
|
||||
Reference in New Issue
Block a user