diff --git a/.dockerfile-frontend b/.dockerfile-frontend deleted file mode 100644 index 9f3584b..0000000 --- a/.dockerfile-frontend +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:6 - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -RUN echo '{ "allow_root": true }' > /root/.bowerrc - -COPY package.json /usr/src/app/ -RUN npm install -RUN npm install -g bower -COPY bower.json /usr/src/app/ -RUN bower install - diff --git a/docker-compose.yml b/docker-compose.yml index f47fe63..37dd5b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,28 +1,28 @@ web: build: . dockerfile: .dockerfile - command: python manage.py runserver 0.0.0.0:5000 + command: gunicorn publichealth.wsgi:application -b 0.0.0.0:5000 -w 5 --log-file=- volumes: - - ./:/usr/src/app + - ./:/usr/src/app + - /var/log/publichealth:/var/log/publichealth links: + - redis - postgres - elasticsearch ports: - "5000:5000" environment: - - ALLOWED_HOSTS=${ALLOWED_HOSTS} - - SECRET_KEY=${SECRET_KEY} - - DEBUG=${DEBUG} - - DEV=${DEBUG} - - DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} - - DATABASE_URL=postgres://postgres:@postgres:5432/postgres - - ELASTICSEARCH_URL=http://elasticsearch:9200 -frontend: - build: . - dockerfile: .dockerfile-frontend - volumes: - - ./:/usr/src/app - working_dir: /usr/src/app + - SECRET_KEY=${SECRET_KEY} + - ALLOWED_HOSTS=${ALLOWED_HOSTS} + - DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} + - DATABASE_URL=postgres://postgres:@postgres:5432/postgres + - ELASTICSEARCH_URL=http://elasticsearch:9200 + - REDIS_URL=redis://redis:6379 + - LOG_DIR=/var/log/publichealth +redis: + image: redis + ports: + - "6379:6379" postgres: image: postgres ports: @@ -30,4 +30,4 @@ postgres: elasticsearch: image: orchardup/elasticsearch ports: - - "9200:9200" + - "9200:9200" diff --git a/publichealth/settings/production.py b/publichealth/settings/production.py index e0d4f38..83f2414 100644 --- a/publichealth/settings/production.py +++ b/publichealth/settings/production.py @@ -7,8 +7,8 @@ from .base import * # Instead, use environment variables or create a local.py file on the server. # Disable debug mode -DEBUG = True -TEMPLATES[0]['OPTIONS']['debug'] = True +DEBUG = False +TEMPLATES[0]['OPTIONS']['debug'] = False # Compress static files offline and minify CSS # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE