File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed
Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1+ FROM python:3.7 as build
2+
3+ WORKDIR /opt
4+ RUN pip install pyinstaller
5+ COPY . /opt
6+ RUN pip wheel -r requirements.txt
7+ RUN pip install -r /opt/requirements.txt && \
8+ python setup.py install && \
9+ pyinstaller -sF ./acme-runner.py
10+
11+
12+ FROM python:3.7-slim
13+
14+ COPY --from=build /opt /opt
15+
16+ WORKDIR /opt
17+ RUN pip install -r /opt/requirements.txt -f /opt && \
18+ python setup.py install && \
19+ cp dist/acme-runner /usr/bin/ && \
20+ rm -rf /opt/* /root/.cache
21+
22+ ENTRYPOINT ["/usr/local/bin/acme-nginx" ]
Original file line number Diff line number Diff line change @@ -106,6 +106,26 @@ cd acme-nginx
106106python setup.py install
107107```
108108
109+ ### Docker way
110+
111+ You can build docker image with acme-nginx inside:
112+
113+ ```
114+ docker build -t acme-nginx .
115+ docker run --rm -v /etc/nginx:/etc/nginx --pid=host \
116+ -d example.com -d www.example.com
117+ ```
118+
119+ There is also single binary in docker image compiled by ` pyinstaller ` , you can copy it like this:
120+
121+ ```
122+ docker run --name acme acme-nginx
123+ docker cp acme:/usr/bin/acme-runner acme-nginx
124+ docker rm acme
125+ ```
126+
127+
128+
109129### Debian/Ubuntu way
110130
111131```
Original file line number Diff line number Diff line change 1717 from urllib2 import urlopen , Request # Python 2
1818
1919
20- __version__ = "0.2.0 "
20+ __version__ = "0.2.1 "
2121
2222
2323class Acme (object ):
Original file line number Diff line number Diff line change 22
33from setuptools import setup , find_packages
44
5- p_version = '0.2.0 '
5+ p_version = '0.2.1 '
66
77with open ('README.md' ) as f :
88 long_description = f .read ()
You can’t perform that action at this time.
0 commit comments