Skip to content

Commit a2035c2

Browse files
author
kshcherban
committed
Create Dockerfile, update readme
1 parent 27ccb0b commit a2035c2

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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"]

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ cd acme-nginx
106106
python 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
```

acme_nginx/Acme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from urllib2 import urlopen, Request # Python 2
1818

1919

20-
__version__ = "0.2.0"
20+
__version__ = "0.2.1"
2121

2222

2323
class Acme(object):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup, find_packages
44

5-
p_version = '0.2.0'
5+
p_version = '0.2.1'
66

77
with open('README.md') as f:
88
long_description = f.read()

0 commit comments

Comments
 (0)