refractr/docker/Dockerfile

31 lines
1 KiB
Docker

FROM rust:1-alpine AS build
ENV REFRACTR_DOCKER="true"
WORKDIR /usr/src/refractr
COPY . .
RUN apk upgrade --no-cache && apk add --no-cache pkgconfig libc-dev openssl-dev openssl openssl-libs-static
RUN cargo install --path . && cargo clean
FROM alpine:3 AS package
ARG VERSION
ARG DATE
LABEL org.opencontainers.image.title="refractr"
LABEL org.opencontainers.image.authors="me@brysonsteck.xyz"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.url="https://git.brysonsteck.xyz/brysonsteck/-/packages/container/refractr/${VERSION}"
LABEL org.opencontainers.image.source="https://git.brysonsteck.xyz/brysonsteck/refractr"
LABEL org.opencontainers.image.licenses="MPL-2.0"
LABEL org.opencontainers.image.created="${DATE}"
RUN apk upgrade --no-cache && apk add --no-cache openssl
RUN mkdir /etc/refractr
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --from=build /usr/src/refractr /usr/src
COPY --from=build /usr/local/cargo/bin/refractr /usr/local/bin
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]