diff --git a/Dockerfile b/Dockerfile index e9c5714..b484bc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM golang:1.23-alpine3.20 as go-builder -ENV GOPATH "" +FROM golang:1.23-alpine3.20 AS go-builder +ENV GOPATH="" RUN apk add git @@ -9,8 +9,24 @@ RUN go mod download ADD ./ . RUN go build -o ./server . + +FROM hugomods/hugo:latest AS blog-builder + +WORKDIR /app + +RUN apk update && \ + apk add git && \ + git clone https://git.netflux.io/rob/netflux-blog blog && \ + cd blog && \ + git submodule update --init --recursive && \ + hugo + + FROM alpine:3.14 COPY --from=go-builder /app/server /app/server +COPY --from=blog-builder /app/blog/public /www/html + +ENV NETFLUX_ROOT_PATH=/www/html ENTRYPOINT ["/app/server"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f38f99 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: deploy +deploy: # build and deploy the latest version of the image. + docker build -t netfluxio/homepage:latest . + docker push netfluxio/homepage:latest