diff --git a/containers/webhook/Containerfile b/containers/webhook/Containerfile index 3bc4eca..54c5bcb 100644 --- a/containers/webhook/Containerfile +++ b/containers/webhook/Containerfile @@ -1,20 +1,22 @@ -FROM registry.fedoraproject.org/fedora:latest +FROM docker.io/library/rust:latest AS chef +RUN cargo install cargo-chef +WORKDIR app -EXPOSE 80 +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json -WORKDIR /volumes/src +FROM chef AS builder +RUN apt update && \ + apt install libsqlite3-dev -y +COPY --from=planner /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path recipe.json +COPY . . +RUN cargo build --release --bin git-webhook-client -ENV DATABASE_URL=/volumes/db/db.sqlite -ENV GWC_CONFIG_FILE=/volumes/src/config.yaml - -RUN dnf upgrade -y && \ - dnf install -y git-lfs sqlite-devel npm && \ - dnf autoremove -y && \ - dnf clean all && \ - git lfs install && \ - curl -Ls https://github.com/getzola/zola/releases/latest/download/zola-v0.16.1-x86_64-unknown-linux-gnu.tar.gz -o zola.tar.gz && \ - tar -xzvf zola.tar.gz && \ - rm zola.tar.gz && \ - mv zola /usr/local/bin - -CMD ["target/release/git-webhook-client"] \ No newline at end of file +FROM docker.io/library/debian:stable-slim AS runtime +WORKDIR app +RUN apt update && \ + apt install libsqlite3-dev -y +COPY --from=builder /app/target/release/git-webhook-client /usr/local/bin/git-webhook-client +CMD ["git-webhook-client"] \ No newline at end of file diff --git a/containers/webhook/webhook.fish b/containers/webhook/webhook.fish index c367c09..817bdfc 100755 --- a/containers/webhook/webhook.fish +++ b/containers/webhook/webhook.fish @@ -22,4 +22,5 @@ podman-default-create \ -v $container_volumes_dir/repos:/volumes/repos:Z \ -v $container_volumes_dir/logs:/volumes/logs:Z \ -v ~/volumes/nginx/sites:/volumes/sites:z \ + -e GWC_CONFIG_FILE=/volumes/src/dev_data/config.yaml \ localhost/$container_name:latest