royalcat
3a310f8a30
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2s
CodeQL / Analyze (javascript) (push) Failing after 2s
docker / build-docker (inux/arm/v6) (push) Failing after 26s
docker / build-docker (linux/386) (push) Failing after 2m22s
docker / build-docker (linux/amd64) (push) Failing after 2m0s
docker / build-docker (linux/arm64) (push) Has been cancelled
docker / build-docker (linux/arm/v7) (push) Has been cancelled
mkdocs / mkdocs (push) Failing after 2s
31 lines
565 B
Docker
31 lines
565 B
Docker
#===============
|
|
# Stage 1: Build
|
|
#===============
|
|
|
|
FROM golang:1.21 as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod ./
|
|
COPY go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY ./src ./src
|
|
COPY ./cmd ./cmd
|
|
COPY ./assets ./assets
|
|
COPY ./templates ./templates
|
|
COPY embed.go embed.go
|
|
|
|
RUN go generate ./...
|
|
RUN CGO_ENABLED=0 go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
|
|
|
|
#===============
|
|
# Stage 2: Run
|
|
#===============
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
COPY --from=builder /tstor /tstor
|
|
|
|
ENTRYPOINT ["/tstor"]
|