diff --git a/Dockerfile b/Dockerfile index 4b8f857..ce1fb3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file +CMD [ "cron", "-f", "-l", "2" ] \ No newline at end of file