shiori/Dockerfile
Felipe Martin 647945c54e
ci: unify local and ci docker workflows (#907)
* deps: go to 1.22.3

* removed ci dockerfile

* add make buildx

* updated dockerfile

* ci uses make buildx command

* commented upx for the future

* disable openbsd/arm tests

* wip

* put dist file in dist path

* removed unused make command

* build-local to speed up local tests

* don't clean when buildx

* podman workaround

* manually define source files for tests
2024-05-14 08:01:52 +02:00

30 lines
808 B
Docker

# Build stage
ARG ALPINE_VERSION
ARG GOLANG_VERSION
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 && \
chmod +x /usr/bin/shiori
# 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>"
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}
ENTRYPOINT ["/usr/bin/shiori"]
CMD ["server"]