Skip to content

Commit

Permalink
Added docker-compose file for development.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Aug 19, 2018
1 parent 20ee12f commit 9a0a5a9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
@@ -0,0 +1,11 @@
build
dist
frontend/node_modules
modoboa.egg-info

.tox

**/.python-version
**/__pycache__
**/*.pyc
**/.ropeproject
14 changes: 14 additions & 0 deletions Dockerfile.dev
@@ -0,0 +1,14 @@
FROM python:3.6-alpine

MAINTAINER Antoine Nguyen <tonio@ngyn.org>

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
18 changes: 18 additions & 0 deletions 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
Binary file added test_project/modoboa.db
Binary file not shown.
4 changes: 1 addition & 3 deletions test_project/test_project/settings.py
Expand Up @@ -30,8 +30,6 @@
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = "DEBUG" in os.environ DEBUG = "DEBUG" in os.environ


TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = [ ALLOWED_HOSTS = [
"127.0.0.1", "127.0.0.1",
"localhost", "localhost",
Expand Down Expand Up @@ -122,7 +120,7 @@
"django.contrib.messages.context_processors.messages", "django.contrib.messages.context_processors.messages",
"modoboa.core.context_processors.top_notifications", "modoboa.core.context_processors.top_notifications",
], ],
"debug": TEMPLATE_DEBUG, "debug": DEBUG,
}, },
}, },
] ]
Expand Down

0 comments on commit 9a0a5a9

Please sign in to comment.