feat: publish docker

This commit is contained in:
Aravinth Manivannan 2023-10-23 19:06:09 +05:30
parent b4106f0718
commit fc4b89792d
Signed by: realaravinth
GPG Key ID: F8F50389936984FF
2 changed files with 24 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
/target
tarpaulin-report.html
.env
out

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
FROM rust:slim as rust
WORKDIR /src
RUN apt-get update && apt-get install -y git pkg-config libssl-dev build-essential
RUN mkdir src && echo "fn main() {}" > src/main.rs
COPY Cargo.toml .
COPY Cargo.lock .
RUN cargo build --release
COPY . /src
RUN cargo build --release
FROM debian:bookworm as mcaptcha-cli
LABEL org.opencontainers.image.source https://github.com/mcaptcha/cli
RUN useradd -ms /bin/bash -u 1001 mcaptcha-cli
WORKDIR /home/mcaptcha-cli
COPY --from=rust /src/target/release/mcaptcha-cli /usr/local/bin/
USER mcaptcha-cli
CMD [ "/usr/local/bin/mcaptcha-cli" ]