Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM alpine:3.19
FROM rust:1.85-alpine AS builder
RUN apk add --no-cache musl-dev musl-dev openssl-dev perl make gcc
WORKDIR /app
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl

ARG TARGET
FROM alpine:3.19

RUN apk add --no-cache curl
RUN apk add --no-cache curl openssl

RUN curl -L "https://github.com/redlib-org/redlib/releases/latest/download/redlib-${TARGET}.tar.gz" | \
tar xz -C /usr/local/bin/
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/redlib /usr/local/bin/redlib
RUN chmod +x /usr/local/bin/redlib

RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
USER redlib
Expand All @@ -17,4 +21,3 @@ EXPOSE 8080
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider -q http://localhost:8080/settings || exit 1

CMD ["redlib"]