diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ac3ce9c2f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +build +dist +frontend/node_modules +modoboa.egg-info + +.tox + +**/.python-version +**/__pycache__ +**/*.pyc +**/.ropeproject diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 000000000..2621f68d3 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,14 @@ +FROM python:3.6-alpine + +MAINTAINER Antoine Nguyen + +RUN apk add --update python3-dev libffi-dev gcc musl-dev libxml2-dev libxslt-dev \ + libressl-dev jpeg-dev \ + && rm -rf /var/cache/apk/* + +WORKDIR /tmp +COPY requirements.txt /tmp +RUN pip install -r requirements.txt + +RUN mkdir /code +WORKDIR /code diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..5630bfb11 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' + +services: + web: + build: + context: . + dockerfile: Dockerfile.dev + expose: + - "8000" + ports: + - "8000:8000" + environment: + PYTHONPATH: ".." + DB: "SQLITE" + DEBUG: "True" + command: sh -c "cd test_project && python3 manage.py migrate && python3 manage.py load_initial_data && python3 manage.py runserver 0:8000" + volumes: + - .:/code diff --git a/test_project/modoboa.db b/test_project/modoboa.db new file mode 100644 index 000000000..a8562b826 Binary files /dev/null and b/test_project/modoboa.db differ diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index 9b5f0e166..364b38f22 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -30,8 +30,6 @@ SECRET_KEY = "!8o(-dbbl3e+*bh7nx-^xysdt)1gso*%@4ze4-9_9o+i&t--u_" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = "DEBUG" in os.environ -TEMPLATE_DEBUG = DEBUG - ALLOWED_HOSTS = [ "127.0.0.1", "localhost", @@ -122,7 +120,7 @@ TEMPLATES = [ "django.contrib.messages.context_processors.messages", "modoboa.core.context_processors.top_notifications", ], - "debug": TEMPLATE_DEBUG, + "debug": DEBUG, }, }, ]