diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..da57daa8b9a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,84 @@ +# Git +.git +.gitignore + +# CI +.codeclimate.yml +.travis.yml + +# Docker +docker-compose.yml +.docker + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] +**/*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env/ +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +**/.ropeproject + +# Vim swap files +**/*.swp + +# Sqlite database +*.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..66b155bde05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# FROM readthedocs/build:latest +FROM python:2.7.13 +# FROM python:3.6.1 + +RUN set -ex; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + elasticsearch \ + redis-server \ + ; \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app +COPY requirements /usr/src/app/requirements +RUN pip install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app/ + +RUN python manage.py migrate +RUN python manage.py createsuperuser --noinput \ + --username root \ + --email dev@localhost +RUN python manage.py collectstatic --noinput +RUN python manage.py loaddata test_data + +CMD python manage.py runserver + +EXPOSE 8000