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
|
2023-10-24 11:39:37 +00:00
|
|
|
FROM golang:1.20 AS build
|
2023-09-26 22:09:02 +00:00
|
|
|
|
2023-10-24 11:39:37 +00:00
|
|
|
# Copy Source
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2023-09-26 22:09:02 +00:00
|
|
|
|
|
|
|
# Create Package Directory
|
2023-09-19 23:29:55 +00:00
|
|
|
RUN mkdir -p /opt/bookmanager
|
|
|
|
|
2023-10-24 11:39:37 +00:00
|
|
|
# Compile
|
|
|
|
RUN go build -o /opt/bookmanager/server; \
|
2023-09-26 22:09:02 +00:00
|
|
|
cp -a ./templates /opt/bookmanager/templates; \
|
|
|
|
cp -a ./assets /opt/bookmanager/assets;
|
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-09-19 23:29:55 +00:00
|
|
|
COPY --from=build /opt/bookmanager /opt/bookmanager
|
|
|
|
WORKDIR /opt/bookmanager
|
2023-09-18 23:57:18 +00:00
|
|
|
EXPOSE 8585
|
2023-09-19 23:29:55 +00:00
|
|
|
ENTRYPOINT ["/opt/bookmanager/server", "serve"]
|