Permalink
Browse files

sandbox: Add docker-compose file

This also updates the settings file to use the values from the environ
  • Loading branch information...
1 parent 68610c0 commit 1d0de1d21ef4bfb752103888bb260adb6abf0973 @mvantellingen mvantellingen committed Jul 30, 2016
Showing with 32 additions and 6 deletions.
  1. +6 −0 .editorconfig
  2. +20 −0 docker-compose.yml
  3. +6 −6 sites/sandbox/settings.py
View
@@ -0,0 +1,6 @@
+root = true
+
+[*.yml]
+indent = 2
+shift_wodth = 2
+
View
@@ -0,0 +1,20 @@
+version: '2'
+
+services:
+ sandbox:
+ build: .
+ environment:
+ DATABASE_ENGINE: django.db.backends.postgresql
+ DATABASE_NAME: postgres
+ DATABASE_HOST: db
+ DATABASE_USER: postgres
+ DATABASE_PASSWORD: postgres
+ ports:
+ - 80:8080
+ links:
+ - db
+ - elasticsearch
+ db:
+ image: postgres:9.5
+ elasticsearch:
+ image: elasticsearch:1.7
@@ -25,12 +25,12 @@
# Use a Sqlite database by default
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': location('db.sqlite'),
- 'USER': '',
- 'PASSWORD': '',
- 'HOST': '',
- 'PORT': '',
+ 'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.sqlite3'),
+ 'NAME': os.environ.get('DATABASE_NAME', location('db.sqlite')),
+ 'USER': os.environ.get('DATABASE_USER', None),
+ 'PASSWORD': os.environ.get('DATABASE_PASSWORD', None),
+ 'HOST': os.environ.get('DATABASE_HOST', None),
+ 'PORT': os.environ.get('DATABASE_PORT', None),
'ATOMIC_REQUESTS': True
}
}

0 comments on commit 1d0de1d

Please sign in to comment.