mirror of
https://codeberg.org/Mo8it/git-webhook-client
synced 2024-11-20 10:56:33 +00:00
Add Containerfile
This commit is contained in:
parent
89789c196b
commit
102d25afaf
2 changed files with 27 additions and 0 deletions
2
.containerignore
Normal file
2
.containerignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
/dev_data/
|
||||
/target/
|
25
Containerfile
Normal file
25
Containerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM docker.io/library/rust:alpine AS chef
|
||||
RUN apk add musl-dev
|
||||
RUN cargo install cargo-chef
|
||||
WORKDIR app
|
||||
|
||||
FROM chef AS planner
|
||||
COPY . .
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
|
||||
FROM chef AS builder
|
||||
RUN apk add musl-dev sqlite-dev
|
||||
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
|
||||
|
||||
FROM docker.io/library/alpine:latest AS runtime
|
||||
WORKDIR app
|
||||
ARG data_dir=/volumes/data
|
||||
ENV DATABASE_URL=$data_dir/db/db.sqlite
|
||||
ENV GWC_CONFIG_FILE=$data_dir/config.yaml
|
||||
RUN apk add git-lfs sqlite-dev npm zola && \
|
||||
git lfs install
|
||||
COPY --from=builder /app/target/release/git-webhook-client /usr/local/bin/git-webhook-client
|
||||
CMD ["git-webhook-client"]
|
Loading…
Reference in a new issue