Change docker image to use cron
This commit is contained in:
parent
a9dfdde9d5
commit
9207200007
@ -15,9 +15,15 @@ RUN cargo build --release
|
||||
#################
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
# Install cron and clean default cron jobs
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -rf /etc/cron.*/*
|
||||
|
||||
RUN echo "0 0,12 * * * root cd /app && ./le-easy-certs >/proc/1/fd/1 2>/proc/1/fd/2\n" > /etc/crontab
|
||||
RUN echo "@reboot root cd /app && ./le-easy-certs >/proc/1/fd/1 2>/proc/1/fd/2\n\n" >> /etc/crontab
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/target/release/le-easy-certs /app/
|
||||
|
||||
ENV LE_CONF=/le-conf/le-conf.toml
|
||||
|
||||
CMD ["./le-easy-certs"]
|
||||
CMD [ "cron", "-f", "-l", "2" ]
|
||||
Loading…
x
Reference in New Issue
Block a user