Deployment support

This commit is contained in:
Oleg Lavrovsky 2017-03-29 00:49:05 +02:00
parent 97a8119efb
commit e898834b06
3 changed files with 18 additions and 31 deletions

View file

@ -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

View file

@ -1,28 +1,28 @@
web: web:
build: . build: .
dockerfile: .dockerfile 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: volumes:
- ./:/usr/src/app - ./:/usr/src/app
- /var/log/publichealth:/var/log/publichealth
links: links:
- redis
- postgres - postgres
- elasticsearch - elasticsearch
ports: ports:
- "5000:5000" - "5000:5000"
environment: environment:
- ALLOWED_HOSTS=${ALLOWED_HOSTS} - SECRET_KEY=${SECRET_KEY}
- SECRET_KEY=${SECRET_KEY} - ALLOWED_HOSTS=${ALLOWED_HOSTS}
- DEBUG=${DEBUG} - DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- DEV=${DEBUG} - DATABASE_URL=postgres://postgres:@postgres:5432/postgres
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} - ELASTICSEARCH_URL=http://elasticsearch:9200
- DATABASE_URL=postgres://postgres:@postgres:5432/postgres - REDIS_URL=redis://redis:6379
- ELASTICSEARCH_URL=http://elasticsearch:9200 - LOG_DIR=/var/log/publichealth
frontend: redis:
build: . image: redis
dockerfile: .dockerfile-frontend ports:
volumes: - "6379:6379"
- ./:/usr/src/app
working_dir: /usr/src/app
postgres: postgres:
image: postgres image: postgres
ports: ports:
@ -30,4 +30,4 @@ postgres:
elasticsearch: elasticsearch:
image: orchardup/elasticsearch image: orchardup/elasticsearch
ports: ports:
- "9200:9200" - "9200:9200"

View file

@ -7,8 +7,8 @@ from .base import *
# Instead, use environment variables or create a local.py file on the server. # Instead, use environment variables or create a local.py file on the server.
# Disable debug mode # Disable debug mode
DEBUG = True DEBUG = False
TEMPLATES[0]['OPTIONS']['debug'] = True TEMPLATES[0]['OPTIONS']['debug'] = False
# Compress static files offline and minify CSS # Compress static files offline and minify CSS
# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE