mirror of
https://git.mills.io/prologic/zs-starter-template.git
synced 2024-11-21 21:06:03 +03:00
35 lines
425 B
Docker
35 lines
425 B
Docker
|
# Build
|
||
|
FROM golang:alpine AS build
|
||
|
|
||
|
ENV CGO_ENABLED=0
|
||
|
|
||
|
RUN apk add --no-cache -U build-base git make
|
||
|
|
||
|
RUN mkdir -p /src
|
||
|
|
||
|
WORKDIR /src
|
||
|
|
||
|
# Copy Makefile
|
||
|
COPY Makefile ./
|
||
|
|
||
|
# Install deps
|
||
|
RUN make deps
|
||
|
|
||
|
# Copy content
|
||
|
COPY . .
|
||
|
|
||
|
# Build the site
|
||
|
RUN make build
|
||
|
|
||
|
# Runtime
|
||
|
FROM scratch
|
||
|
|
||
|
WORKDIR /
|
||
|
VOLUME /data
|
||
|
|
||
|
COPY --from=build /go/bin/static /static
|
||
|
COPY --from=build /src/.pub /data
|
||
|
|
||
|
ENTRYPOINT ["/static"]
|
||
|
CMD ["-r", "/data"]
|