feat: dockerized project

This commit is contained in:
antifallobst 2023-10-07 10:53:48 +02:00
parent eeed35e0b5
commit 5c564adafb
Signed by: antifallobst
GPG Key ID: 2B4F402172791BAF
2 changed files with 33 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
target
doc
db.sqlite

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM rust:latest as build
RUN apt-get update; \
apt-get install -y libclang-dev automake autoconf
RUN USER=root cargo new --bin baseauth
WORKDIR /baseauth
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release
RUN rm src/*.rs
COPY ./src ./src
RUN rm ./target/release/deps/baseauth*
RUN cargo build --release
FROM debian:bookworm-slim
COPY --from=build /baseauth/target/release/baseauth /bin/baseauth
RUN apt-get update; \
apt-get install -y libsqlite3-dev
RUN mkdir /data
VOLUME /data
CMD ["/bin/baseauth", "-w", "/data", "-D", "8080"]