diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..c6e74a3 --- /dev/null +++ b/Containerfile @@ -0,0 +1,20 @@ +FROM lukemathwalker/cargo-chef:latest-rust-alpine as chef +WORKDIR /app + +FROM chef AS planner +COPY ./Cargo.toml ./Cargo.lock ./ +COPY ./src ./src +RUN cargo chef prepare + +FROM chef AS builder +COPY --from=planner /app/recipe.json . +RUN cargo chef cook --release +COPY . . +RUN cargo build --release +RUN mv ./target/release/metasearch2 ./app + +FROM scratch AS runtime +WORKDIR /app +COPY --from=builder /app/app /usr/local/bin/ +EXPOSE 28019 +ENTRYPOINT ["/usr/local/bin/app"] diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..5832886 --- /dev/null +++ b/compose.yml @@ -0,0 +1,9 @@ +version: '3.7' + +services: + metasearch2: + build: + context: . + dockerfile: Containerfile + network_mode: "host" + restart: unless-stopped