build: update Dockerfile
This commit is contained in:
parent
a9caca2772
commit
881f37f89c
20
Dockerfile
20
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"]
|
||||
|
|
Loading…
Reference in New Issue