Skip to content

Commit 3344e55

Browse files
Docker enhancements (#85)
1 parent a51be7f commit 3344e55

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!docker-entrypoint.sh

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ certbot.log
2424
/*.pem
2525
.env
2626
env.list
27+
letsencrypt

Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
FROM python:3.6-alpine
2-
ENTRYPOINT [ "certbot" ]
32

43
VOLUME /etc/letsencrypt /var/lib/letsencrypt
54
WORKDIR /opt/certbot
65

6+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
7+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
8+
79
RUN apk add --no-cache --virtual .certbot-deps \
810
libffi \
911
libssl1.1 \
@@ -19,3 +21,6 @@ RUN apk add --no-cache --virtual .build-deps \
1921
&& pip install urllib3==1.25.11 \
2022
&& pip install certbot-s3front \
2123
&& apk del .build-deps
24+
25+
26+
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Then export the environment variables to an `env.list` file:
8282
```bash
8383
echo AWS_ACCESS_KEY_ID=YOUR_ID >> env.list
8484
echo AWS_SECRET_ACCESS_KEY=YOUR_KEY >> env.list
85+
echo AWS_S3_BUCKET=YOUR_S3_BUCKET_NAME >> env.list
86+
echo AWS_DISTRIBUTION_ID=YOUR_DISTRIBUTION_ID >> env.list
87+
echo DOMAIN=YOUR_DOMAIN >> env.list
88+
echo EMAIL=YOUR_EMAIL >> env.list
8589
```
8690

8791
And finally run the docker image:
@@ -91,11 +95,4 @@ docker run --rm --name lets-encrypt -it \
9195
-v ./letsencrypt/:/etc/letsencrypt \
9296
--env-file env.list \
9397
certbot-s3front \
94-
--init \
95-
--agree-tos \
96-
-a certbot-s3front:auth \
97-
-i certbot-s3front:installer \
98-
--certbot-s3front:auth-s3-bucket <YOUR_AWS_S3_BUCKET> \
99-
--certbot-s3front:installer-cf-distribution-id <YOUR_AWS_CLOUDFRONT_DISTRIBUTION_ID> \
100-
-d <YOUR_DOMAIN>
10198
```

docker-entrypoint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
/usr/local/bin/certbot -n --init --agree-tos -a certbot-s3front:auth -i certbot-s3front:installer --certbot-s3front:auth-s3-bucket $AWS_S3_BUCKET --certbot-s3front:installer-cf-distribution-id $AWS_DISTRIBUTION_ID --email $EMAIL -d $DOMAIN

0 commit comments

Comments
 (0)