Skip to content
Permalink
Browse files

Using docker for development

  • Loading branch information...
sebinthomas authored and cyriac committed Jun 16, 2016
1 parent c2f0054 commit dc9d51f22ed59fed393e76f3266a49178686759d
Showing with 66 additions and 0 deletions.
  1. +12 −0 Dockerfile
  2. +8 −0 INSTALL.md
  3. +20 −0 docker-compose.yml
  4. +21 −0 stormtrooper/stormtrooper/docker_settings.py
  5. +5 −0 stormtrooper/stormtrooper/settings.py
@@ -0,0 +1,12 @@
FROM python:2.7.11

ENV PYTHONBUFFERED 1
ENV APPLICATION_ROOT /stormtrooper/

RUN mkdir -p $APPLICATION_ROOT
WORKDIR $APPLICATION_ROOT
ADD requirements.txt $APPLICATION_ROOT
ADD requirements-dev.txt $APPLICATION_ROOT
RUN pip install -r requirements.txt
RUN pip install -r requirements-dev.txt
ADD . $APPLICATION_ROOT
@@ -1,5 +1,13 @@
# Installation

## Docker

install docker

pip install docker-compose
docker-compose up
docker exec stormtrooper_db_1 createdb -Upostgres stormtrooper

## Database (postgres 9.4)

CREATE DATABASE stormtrooper;
@@ -0,0 +1,20 @@
web:
build: .
command: bash -c "python /stormtrooper/stormtrooper/manage.py migrate && python /stormtrooper/stormtrooper/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/stormtrooper
ports:
- "8000:8000"
links:
- db
- redis

db:
image: postgres:9.5
environment:
POSTGRES_PASSWORD: postgres

redis:
image: redis:latest
ports:
- "6379"
@@ -0,0 +1,21 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'stormtrooper',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'db',
'PORT': '',
}
}

CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": ['redis://redis'],
},
"ROUTING": "stormtrooper.routing.channel_routing"
}
}
@@ -153,6 +153,11 @@
}
}

try:
from docker_settings import *
except ImportError:
pass

try:
from local_settings import *
except ImportError:

0 comments on commit dc9d51f

Please sign in to comment.
You can’t perform that action at this time.