This repository has been archived on 2024-06-08. You can view files and clone it, but cannot push or open issues or pull requests.
powd/Dockerfile

29 lines
809 B
Text
Raw Normal View History

2023-08-03 16:05:48 +05:30
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
FROM rust:latest as planner
RUN cargo install cargo-chef
WORKDIR /src
COPY . /src/
RUN cargo chef prepare --recipe-path recipe.json
FROM rust:latest as cacher
WORKDIR /src/
RUN cargo install cargo-chef
COPY --from=planner /src/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
FROM rust:latest as rust
WORKDIR /src
COPY . .
COPY --from=cacher /src/target target
RUN cargo build --release
FROM debian:bullseye as powd
LABEL org.opencontainers.image.source https://git.batsense.net/mcaptcha/powd
RUN useradd -ms /bin/bash -u 1001 powd
WORKDIR /home/powd
COPY --from=rust /src/target/release/powd /usr/local/bin/
USER powd
CMD [ "/usr/local/bin/powd" ]