Evan Reichard
a34906c266
All checks were successful
continuous-integration/drone/push Build is passing
27 lines
679 B
Plaintext
27 lines
679 B
Plaintext
# Certificate Store
|
|
FROM alpine AS certs
|
|
RUN apk update && apk add ca-certificates
|
|
|
|
# Build Image
|
|
FROM --platform=$BUILDPLATFORM golang:1.20 AS build
|
|
|
|
# Create Package Directory
|
|
WORKDIR /src
|
|
RUN mkdir -p /opt/antholume
|
|
|
|
# Cache Dependencies & Compile
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
RUN --mount=target=. \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
--mount=type=cache,target=/go/pkg \
|
|
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /opt/antholume/server
|
|
|
|
# Create Image
|
|
FROM busybox:1.36
|
|
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
|
|
COPY --from=build /opt/antholume /opt/antholume
|
|
WORKDIR /opt/antholume
|
|
EXPOSE 8585
|
|
ENTRYPOINT ["/opt/antholume/server", "serve"]
|