refractr/package.Dockerfile

29 lines
681 B
Docker

FROM rust:1-bookworm AS build
ARG VERSION
ENV REFRACTR_DOCKER="true"
LABEL org.opencontainers.image.authors="me@brysonsteck.xyz"
LABEL version="${VERSION}"
LABEL license="MPL-2.0"
WORKDIR /usr/src/refractr
COPY . .
RUN apt update && apt install pkg-config libssl-dev -y
RUN cargo install --path . && cargo clean
FROM alpine:3 AS package
ARG UID="1000"
ARG GID="1000"
COPY --from=build /usr/src/refractr /usr/src
COPY --from=build /usr/local/cargo/bin/refractr /usr/local/bin
RUN apk upgrade --no-cache
RUN addgroup -g $GID refractr && adduser -u $UID -G refractr -DH refractr
RUN mkdir /etc/refractr && chown refractr:refractr /etc/refractr
USER refractr
CMD ["refractr"]