Evan Reichard
b20121b996
All checks were successful
continuous-integration/drone/push Build is passing
31 lines
619 B
Docker
31 lines
619 B
Docker
# Certificate Store
|
|
FROM alpine AS certs
|
|
RUN apk update && apk add ca-certificates
|
|
|
|
# Build Image
|
|
FROM golang:1.21 AS build
|
|
|
|
# Create Package Directory
|
|
RUN mkdir -p /opt/antholume
|
|
|
|
# Copy Source
|
|
WORKDIR /src
|
|
COPY . .
|
|
|
|
# Test
|
|
RUN git log --oneline | head
|
|
RUN git describe --tags
|
|
|
|
# Compile
|
|
RUN go build \
|
|
-ldflags "-X reichard.io/antholume/config.version=`git describe --tags`" \
|
|
-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"]
|