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>
VOLUME /certs
VOLUME /etc/letsencrypt
EXPOSE 80
RUN apk add --no-cache --virtual .build-deps linux-headers gcc musl-dev\
&& apk add --no-cache libffi-dev openssl-dev dialog\
&& pip install certbot\
&& apk del .build-deps\
&& mkdir /scripts
RUN apt update && apt install -y cron
RUN pip install certbot
RUN mkdir /scripts
ADD crontab /etc/crontabs
RUN crontab /etc/crontabs/crontab
ADD ./crontab /etc/cron.d/certbot
RUN crontab /etc/cron.d/certbot
COPY ./scripts/ /scripts
RUN chmod +x /scripts/run_certbot.sh
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'
services:
# Example docker-compose service
certbot:
build: .
container_name: certbot
@ -11,5 +12,5 @@ services:
- WEBROOT=""
- DOMAINS=domain1.com domain2.com
- EMAIL=webmaster@domain1.com
- CONCAT=true
- CONCAT=false
- SEPARATE=true

3
scripts/entrypoint.sh Normal file
View File

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