home/build/Dockerfile

31 lines
466 B
Docker
Raw Normal View History

2023-11-07 20:06:21 +00:00
# syntax=docker/dockerfile:1
# docker build --rm -f build/Dockerfile -t source.toby3d.me/toby3d/home .
# Build
FROM golang:alpine AS builder
WORKDIR /app
ENV CGO_ENABLED=0
ENV GOFLAGS="-mod=vendor -buildvcs=true"
COPY go.mod go.sum *.go ./
COPY internal ./internal/
COPY web ./web/
2023-11-07 20:06:21 +00:00
COPY vendor ./vendor/
RUN go build -o ./home
# Run
FROM scratch
WORKDIR /
COPY --from=builder /app/home /home
2023-11-08 02:57:11 +00:00
VOLUME ["/content", "/theme"]
2023-11-07 20:06:21 +00:00
EXPOSE 3000
ENTRYPOINT ["/home"]