redsunlib/Dockerfile

33 lines
633 B
Docker
Raw Permalink Normal View History

2024-04-05 00:35:01 +13:00
FROM rust:1.77.1-buster AS builder
WORKDIR /app
COPY ./ ./
RUN cargo build --release
FROM debian:stable
2021-04-10 10:24:47 +12:00
ARG TARGET
2021-04-10 10:24:47 +12:00
2024-04-05 00:35:01 +13:00
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
2021-04-10 10:24:47 +12:00
2024-04-05 00:35:01 +13:00
COPY --from=builder /app/target/release/ /usr/local/bin
2020-10-26 09:48:44 +13:00
2023-12-27 12:25:52 +13:00
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
2024-04-05 00:35:01 +13:00
2023-12-27 12:25:52 +13:00
USER redlib
2021-04-10 10:24:47 +12:00
2024-04-05 00:35:01 +13:00
# Tell Docker to expose port 808
EXPOSE 8080
2021-04-10 10:24:47 +12:00
2023-12-27 12:25:52 +13:00
# Run a healthcheck every minute to make sure redlib is functional
2021-04-10 17:38:13 +12:00
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider --q http://localhost:8080/settings || exit 1
2021-04-02 08:09:08 +13:00
CMD ["redlib"]