refractr/docker/Dockerfile

32 lines
1 KiB
Text
Raw Normal View History

2025-05-12 00:03:54 -06:00
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="bryson@steck.dev"
2025-05-12 00:03:54 -06:00
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.url="https://forge.steck.dev/bryson/-/packages/container/refractr/${VERSION}"
LABEL org.opencontainers.image.source="https://forge.steck.dev/bryson/refractr"
2025-05-12 00:03:54 -06:00
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"]