-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (25 loc) · 995 Bytes
/
Dockerfile
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 alpine:3.19 AS install
ARG ACME_SH_GIT_REF=afacdfcb95e063325d8f01ebc8daa57322307d92
RUN apk add --no-cache git curl bash openssl
WORKDIR /
RUN git clone https://github.com/acmesh-official/acme.sh.git acme.sh-git
WORKDIR /acme.sh-git
RUN git checkout "$ACME_SH_GIT_REF"
RUN CA_HOME=/data/ca ./acme.sh --install --home /acme.sh --cert-home /data/certs --no-cron --no-profile && rm /acme.sh/account.conf
FROM alpine:3.19
RUN apk upgrade --no-cache
RUN apk add --no-cache curl bash openssl
ENV CERT_HOME /data/certs
ENV CA_HOME /data/ca
ENV LE_WORKING_DIR /acme.sh
ENV HTTP_HEADER /data/http.header
ENV ACCOUNT_CONF_PATH /data/account.conf
RUN adduser -h / -s /bin/bash -D -H -u 1000 acme
COPY --from=install --chown=acme:0 /acme.sh /acme.sh
RUN mkdir /data && chown acme /data && \
mkdir $CERT_HOME && chown acme $CERT_HOME && \
mkdir $CA_HOME && chown acme $CA_HOME
RUN ln -s /acme.sh/acme.sh /usr/local/bin/
COPY cron.sh /usr/local/bin/cron
USER acme
CMD ["/bin/bash"]