fix dockerfile

This commit is contained in:
ayaka 2024-06-05 10:38:15 +12:00
parent f8f964741a
commit 10d5b4a583

View File

@ -4,7 +4,7 @@ FROM rust:alpine AS builder
RUN apk add --no-cache musl-dev git
WORKDIR /redlib
WORKDIR /redsunlib
COPY . .
@ -19,16 +19,16 @@ COPY --from=builder /usr/share/ca-certificates /usr/share/ca-certificates
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
# Copy our build
COPY --from=builder /redlib/target/x86_64-unknown-linux-musl/release/redlib /usr/local/bin/redlib
COPY --from=builder /redsunlib/target/x86_64-unknown-linux-musl/release/redsunlib /usr/local/bin/redsunlib
# Use an unprivileged user.
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
USER redlib
RUN adduser --home /nonexistent --no-create-home --disabled-password redsunlib
USER redsunlib
# Tell Docker to expose port 8080
EXPOSE 8080
# Run a healthcheck every minute to make sure redlib is functional
# Run a healthcheck every minute to make sure redsunlib is functional
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider -q http://localhost:8080/settings || exit 1
CMD ["redlib"]
CMD ["redsunlib"]