Merge pull request #8 from samueldg/feature/dockerized_app

looks good. agree that the redis is better separated from snappass's dockerfile. Thanks for the dockerizing snappass.
This commit is contained in:
Yongwen Xu 2016-07-18 15:39:02 -07:00 committed by GitHub
commit 8360cf4498
5 changed files with 70 additions and 0 deletions

20
.dockerignore Normal file
View file

@ -0,0 +1,20 @@
# Source
.bumpversion.cfg
.dockerignore
.gitignore
.travis.yml
CONTRIBUTING.rst
docker-compose.yml
Dockerfile
requirements.txt
tests.py
tox.ini
# Generated
.tox
.coverage
*.rdb
junit*xml
# Other
.project

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM python:3.3
ENV APP_DIR=/usr/src/snappass
RUN groupadd -r snappass && \
useradd -r -g snappass snappass && \
mkdir -p $APP_DIR
WORKDIR $APP_DIR
COPY ["setup.py", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"]
COPY ["./snappass", "$APP_DIR/snappass"]
RUN python setup.py install && \
chown -R snappass $APP_DIR && \
chgrp -R snappass $APP_DIR
USER snappass
# Default Flask port
EXPOSE 5000
CMD ["snappass"]

View file

@ -59,3 +59,16 @@ be kept secret. See the `Flask Documentation`_ for more information.
need to change this.
`NO_SSL` if you are not using SSL.
Docker
------
Alternatively, you can use `Docker`_ to install and run SnapPass:
.. _Docker: https://www.docker.com/
::
$ docker build -t snappass .
$ docker-compose up -d
This will pull all dependencies, i.e. Redis and appropriate Python version.

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
---
snappass:
image: snappass
ports:
- "5000:5000"
links:
- "redis:redis"
environment:
- REDIS_HOST=redis
- NO_SSL=True
redis:
image: "redis:latest"

View file

@ -32,5 +32,6 @@ setup(
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
zip_safe=False,
)