Merge pull request #1 from mrcbax/master

silly containers
This commit is contained in:
mat 2024-02-02 21:49:39 -06:00 committed by GitHub
commit ce998e783d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

20
Containerfile Normal file
View File

@ -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"]

9
compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '3.7'
services:
metasearch2:
build:
context: .
dockerfile: Containerfile
network_mode: "host"
restart: unless-stopped