From b34b5c4b69f9fdea4f679bfb29eec7c57b7e1750 Mon Sep 17 00:00:00 2001 From: Samuel Dion-Girardeau Date: Sat, 16 Jul 2016 06:57:18 -0700 Subject: [PATCH] Add Dockerfile/.dockerignore files --- .dockerignore | 20 ++++++++++++++++++++ Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile 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"]