From f2c7454bf432982c24fe302d0b269ef10d794739 Mon Sep 17 00:00:00 2001 From: ayaka Date: Fri, 5 Apr 2024 00:35:01 +1300 Subject: [PATCH] quick build for a quick fix --- .dockerignore | 5 +++++ Dockerfile | 22 +++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3645101 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +target +Dockerfile +.dockerignore +.git +.gitignore diff --git a/Dockerfile b/Dockerfile index 9412565..a749239 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,28 @@ -FROM alpine:3.19 +FROM rust:1.77.1-buster AS builder + +WORKDIR /app + +COPY ./ ./ + +RUN cargo build --release + +FROM debian:stable ARG TARGET -RUN apk add --no-cache curl +RUN apt-get update +RUN apt-get install -y ca-certificates -RUN curl -L https://github.com/redlib-org/redlib/releases/latest/download/redlib-${TARGET}.tar.gz | \ - tar xz -C /usr/local/bin/ +RUN apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +COPY --from=builder /app/target/release/ /usr/local/bin RUN adduser --home /nonexistent --no-create-home --disabled-password redlib + USER redlib -# Tell Docker to expose port 8080 +# Tell Docker to expose port 808 EXPOSE 8080 # Run a healthcheck every minute to make sure redlib is functional