2024-05-14 14:01:52 +08:00
|
|
|
# Build stage
|
|
|
|
ARG ALPINE_VERSION
|
|
|
|
ARG GOLANG_VERSION
|
2020-08-12 06:51:30 +08:00
|
|
|
|
2024-05-14 14:01:52 +08:00
|
|
|
FROM docker.io/library/alpine:${ALPINE_VERSION} AS builder
|
|
|
|
ARG TARGETARCH
|
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETVARIANT
|
|
|
|
COPY dist/shiori_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}/shiori /usr/bin/shiori
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata && \
|
2024-05-15 23:02:59 +08:00
|
|
|
chmod +x /usr/bin/shiori && \
|
|
|
|
rm -rf /tmp/*
|
2024-05-14 14:01:52 +08:00
|
|
|
|
|
|
|
# Server image
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
ENV PORT 8080
|
|
|
|
ENV SHIORI_DIR=/shiori
|
|
|
|
WORKDIR ${SHIORI_DIR}
|
|
|
|
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/go-shiori/shiori"
|
|
|
|
LABEL maintainer="Felipe Martin <github@fmartingr.com>"
|
|
|
|
|
2024-05-15 23:02:59 +08:00
|
|
|
COPY --from=builder /tmp /tmp
|
2024-05-14 14:01:52 +08:00
|
|
|
COPY --from=builder /usr/bin/shiori /usr/bin/shiori
|
|
|
|
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
2022-02-13 23:38:54 +08:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/shiori"]
|
2023-07-20 00:25:41 +08:00
|
|
|
CMD ["server"]
|