netflux-homepage/Dockerfile

33 lines
574 B
Docker

FROM golang:1.23-alpine3.20 AS go-builder
ENV GOPATH=""
RUN apk add git
WORKDIR /app
ADD go.mod go.sum ./
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"]