From 9a2bf497a42c99f8472866f35642553ce78746da Mon Sep 17 00:00:00 2001 From: Chad Baxter Date: Mon, 22 Jan 2024 00:31:08 -0500 Subject: [PATCH] silly containers --- Containerfile | 24 ++++++++++++++++++++++++ container-compose.yml | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Containerfile create mode 100644 container-compose.yml diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..5be4317 --- /dev/null +++ b/Containerfile @@ -0,0 +1,24 @@ +FROM lukemathwalker/cargo-chef:latest-rust-alpine as chef +WORKDIR /app + +FROM chef AS planner +COPY ./Cargo.toml ./Cargo.lock ./ +COPY ./src ./src +RUN apk add sed +RUN sed -i 's/\[::\]/0.0.0.0/g' /app/src/web/mod.rs +RUN cargo chef prepare + +FROM chef AS builder +COPY --from=planner /app/recipe.json . +RUN cargo chef cook --release +COPY . . +RUN apk add sed +RUN sed -i 's/\[::\]/0.0.0.0/g' /app/src/web/mod.rs +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/container-compose.yml b/container-compose.yml new file mode 100644 index 0000000..c2604ff --- /dev/null +++ b/container-compose.yml @@ -0,0 +1,11 @@ +version: '3.7' + +services: + honeyup: + container_name: metasearch2 + build: + context: . + dockerfile: Containerfile + ports: + - '28019:28019' + restart: unless-stopped