-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
43 lines (33 loc) · 1003 Bytes
/
Containerfile
File metadata and controls
43 lines (33 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM python:3.12-alpine as base
# update os
RUN apk add --no-cache --virtual .build-deps \
gcc \
linux-headers \
openssl-dev \
musl-dev \
libffi-dev \
python3-dev \
cargo \
git \
pkgconfig
# install certbot
RUN python3 -m venv /opt/certbot/ && \
/opt/certbot/bin/pip install --upgrade pip && \
/opt/certbot/bin/pip install certbot certbot-nginx && \
ln -s /opt/certbot/bin/certbot /usr/bin/certbot
# make runtime
FROM python:3.12-alpine as runtime
COPY --from=base /opt/certbot /opt/certbot
RUN apk add --no-cache \
bash \
nginx
RUN ln -s /opt/certbot/bin/certbot /usr/bin/certbot
EXPOSE 80 443
# make the certs in a volume to persist during restarts
VOLUME /etc/letsencrypt
# copy in our execution script
COPY src/* /root/
# link our logs
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
# start the container process
CMD ["bash","/root/nginx_run.sh"]