Skip to content

Commit

Permalink
Use SQLite3 as the database back-end to simplify local development
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmerrifield committed Jun 27, 2018
1 parent 2c2503c commit 3f2cd73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
16 changes: 2 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
version: '2'
services:
db:
container_name: db
image: mysql:5.7
environment:
- "MYSQL_ALLOW_EMPTY_PASSWORD=True"
ports:
- "3306:3306"
volumes:
- "./docker/data:/docker-entrypoint-initdb.d" # Put data here to be loaded on container creation
working_dir: "/docker-entrypoint-initdb.d"

drchrono:
container_name: drchrono
image: drchrono
env_file:
- "docker/environment" # Any environmental variables you want can go in this plain text file. See the docs.
# Any environmental variables you want can go in this plain text file. See the docs.
- "docker/environment"
ports:
- "8080:8080"
# command: /bin/bash -c "while true; do echo mark; sleep 2; done"
command: /bin/bash -c "python ./manage.py migrate && python ./manage.py runserver 0.0.0.0:8080"
volumes:
- ".:/usr/src/app"
working_dir: /usr/src/app
depends_on:
- "db"
build:
context: .
dockerfile: ./docker/drchrono-dockerfile
13 changes: 2 additions & 11 deletions drchrono/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,10 @@

# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

# I've included a docker-compose.yml file with a MySQL DB and a python app server for you to use if you'd like. If you
# don't like docker, that's fine (seriously). For this interview, use whatever development environment tools you feel
# most comfortable with. We really don't care; we're interested in your code, not your toolchain.
# TODO: If you don't use docker, change the DB config to make it work with your own tools.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'drchrono',
'USER': 'root',
'PASSWORD': '',
'HOST': 'db', # Or an IP Address that your DB is hosted on
'PORT': '3306',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'drchrono.sqlite3',
}
}

Expand Down

0 comments on commit 3f2cd73

Please sign in to comment.