2023-09-26 22:09:02 +00:00
|
|
|
# Certificate Store
|
2023-10-24 11:39:37 +00:00
|
|
|
FROM alpine AS certs
|
2023-09-26 22:09:02 +00:00
|
|
|
RUN apk update && apk add ca-certificates
|
2023-09-19 23:29:55 +00:00
|
|
|
|
2023-09-26 22:09:02 +00:00
|
|
|
# Build Image
|
2024-01-20 19:26:26 +00:00
|
|
|
FROM golang:1.21 AS build
|
2023-09-26 22:09:02 +00:00
|
|
|
|
2024-01-20 20:28:53 +00:00
|
|
|
# Create Package Directory
|
|
|
|
RUN mkdir -p /opt/antholume
|
|
|
|
|
2023-10-24 11:39:37 +00:00
|
|
|
# Copy Source
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2023-09-26 22:09:02 +00:00
|
|
|
|
2024-01-22 22:52:48 +00:00
|
|
|
# Test
|
|
|
|
RUN git log --oneline | head
|
|
|
|
RUN git describe --tags
|
|
|
|
|
2023-10-24 11:39:37 +00:00
|
|
|
# Compile
|
2024-01-20 19:26:26 +00:00
|
|
|
RUN go build \
|
|
|
|
-ldflags "-X reichard.io/antholume/config.version=`git describe --tags`" \
|
|
|
|
-o /opt/antholume/server
|
2023-09-18 23:57:18 +00:00
|
|
|
|
2023-09-19 23:29:55 +00:00
|
|
|
# Create Image
|
2023-09-26 22:09:02 +00:00
|
|
|
FROM busybox:1.36
|
|
|
|
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
|
2023-11-04 23:40:32 +00:00
|
|
|
COPY --from=build /opt/antholume /opt/antholume
|
|
|
|
WORKDIR /opt/antholume
|
2023-09-18 23:57:18 +00:00
|
|
|
EXPOSE 8585
|
2023-11-04 23:40:32 +00:00
|
|
|
ENTRYPOINT ["/opt/antholume/server", "serve"]
|