Skip to content

Commit

Permalink
Create Dockerfile, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kshcherban committed Sep 14, 2019
1 parent 27ccb0b commit a2035c2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.7 as build

WORKDIR /opt
RUN pip install pyinstaller
COPY . /opt
RUN pip wheel -r requirements.txt
RUN pip install -r /opt/requirements.txt && \
python setup.py install && \
pyinstaller -sF ./acme-runner.py


FROM python:3.7-slim

COPY --from=build /opt /opt

WORKDIR /opt
RUN pip install -r /opt/requirements.txt -f /opt && \
python setup.py install && \
cp dist/acme-runner /usr/bin/ && \
rm -rf /opt/* /root/.cache

ENTRYPOINT ["/usr/local/bin/acme-nginx"]
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,26 @@ cd acme-nginx
python setup.py install
```

### Docker way

You can build docker image with acme-nginx inside:

```
docker build -t acme-nginx .
docker run --rm -v /etc/nginx:/etc/nginx --pid=host \
-d example.com -d www.example.com
```

There is also single binary in docker image compiled by `pyinstaller` , you can copy it like this:

```
docker run --name acme acme-nginx
docker cp acme:/usr/bin/acme-runner acme-nginx
docker rm acme
```



### Debian/Ubuntu way

```
Expand Down
2 changes: 1 addition & 1 deletion acme_nginx/Acme.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from urllib2 import urlopen, Request # Python 2


__version__ = "0.2.0"
__version__ = "0.2.1"


class Acme(object):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

p_version = '0.2.0'
p_version = '0.2.1'

with open('README.md') as f:
long_description = f.read()
Expand Down

0 comments on commit a2035c2

Please sign in to comment.