Customizations

This commit is contained in:
Elliot Saba 2017-01-01 12:58:42 -08:00
parent b621ba06ed
commit d77ba8c122
5 changed files with 20 additions and 12 deletions

View File

@ -1,21 +1,18 @@
FROM python:2-alpine FROM python:2
MAINTAINER Henri Dwyer <henri@dwyer.io> MAINTAINER Henri Dwyer <henri@dwyer.io>
VOLUME /certs
VOLUME /etc/letsencrypt VOLUME /etc/letsencrypt
EXPOSE 80 EXPOSE 80
RUN apk add --no-cache --virtual .build-deps linux-headers gcc musl-dev\ RUN apt update && apt install -y cron
&& apk add --no-cache libffi-dev openssl-dev dialog\ RUN pip install certbot
&& pip install certbot\ RUN mkdir /scripts
&& apk del .build-deps\
&& mkdir /scripts
ADD crontab /etc/crontabs ADD ./crontab /etc/cron.d/certbot
RUN crontab /etc/crontabs/crontab RUN crontab /etc/cron.d/certbot
COPY ./scripts/ /scripts COPY ./scripts/ /scripts
RUN chmod +x /scripts/run_certbot.sh RUN chmod +x /scripts/run_certbot.sh
ENTRYPOINT [] ENTRYPOINT []
CMD ["crond", "-f"] CMD ["/scripts/entrypoint.sh"]

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
all: build
build: Makefile Dockerfile
docker build --squash -t staticfloat/docker-letsencrypt-cron .
push: build
docker push staticfloat/docker-letsencrypt-cron

View File

@ -1 +1 @@
0 3 1 */2 * root sh /scripts/run_certbot.sh 0 */12 * * * root sh /scripts/run_certbot.sh

View File

@ -1,6 +1,7 @@
version: '2' version: '2'
services: services:
# Example docker-compose service
certbot: certbot:
build: . build: .
container_name: certbot container_name: certbot
@ -11,5 +12,5 @@ services:
- WEBROOT="" - WEBROOT=""
- DOMAINS=domain1.com domain2.com - DOMAINS=domain1.com domain2.com
- EMAIL=webmaster@domain1.com - EMAIL=webmaster@domain1.com
- CONCAT=true - CONCAT=false
- SEPARATE=true - SEPARATE=true

3
scripts/entrypoint.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/scripts/run_certbot.sh
crond -f