diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..67d158d --- /dev/null +++ b/.dockerignore @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..257f59d --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.rst b/README.rst index 500e8e1..915b854 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3007635 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +--- +snappass: + image: snappass + ports: + - "5000:5000" + links: + - "redis:redis" + environment: + - REDIS_HOST=redis + - NO_SSL=True + +redis: + image: "redis:latest" diff --git a/setup.py b/setup.py index edce534..f6c0408 100644 --- a/setup.py +++ b/setup.py @@ -32,5 +32,6 @@ setup( 'Programming Language :: Python :: 3.3', 'Topic :: Software Development :: Libraries :: Python Modules', ], + zip_safe=False, )