add build
This commit is contained in:
parent
30b27aea44
commit
6991fc6ae3
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
FROM rust:1.77.1-buster AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./ ./
|
||||||
|
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
FROM debian:stable
|
||||||
|
|
||||||
|
ARG TARGET
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y ca-certificates wget
|
||||||
|
|
||||||
|
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 808
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Run a healthcheck every minute to make sure redlib is functional
|
||||||
|
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider --q http://localhost:8080/settings || exit 1
|
||||||
|
|
||||||
|
CMD ["redlib"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user