FROM certbot/certbot:latest

#SHELL ["/bin/ash", "-ex", "-c"]

# Install socat
RUN apk --no-cache add socat

# Copy scripts
COPY ./docker/scripts/ /opt/scripts/
RUN chmod 755 /opt/scripts/*.sh

# Expose port 380
EXPOSE 380

ENTRYPOINT /bin/sh -c 'trap exit TERM; while :; do /opt/scripts/1-renew-cert.sh ; sleep 12h & wait \${!}; done;'


