Add Amazon EB config files.

This commit is contained in:
Christopher Charbonneau Wells 2017-11-16 10:57:49 -05:00
parent 2221382b4b
commit 65c46351cb
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,43 @@
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: babybuddy.settings.eb
SECRET_KEY: CHANGETOSOMETHINGRANDOM
aws:elasticbeanstalk:container:python:staticfiles:
'/static/': 'static/'
aws:elasticbeanstalk:container:python:
WSGIPath: babybuddy/wsgi.py
commands:
01_remove_outdated_nodejs:
cwd: /tmp
command: 'yum remove -y nodejs npm'
02_node_source_add:
cwd: /tmp
command: 'curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -'
03_npm_install:
cwd: /tmp
command: 'yum -y install nodejs git gcc-c++ make'
04_gulp_install:
cwd: /tmp
command: 'npm install -g gulp-cli'
container_commands:
01_pipenv_install:
command: 'pip install pipenv'
02_requirments_install:
env:
LC_ALL: en_US.utf8
LANG: en_US.utf8
command: 'pipenv lock -r | pip install -r /dev/stdin'
03_npm_install:
command: 'npm install'
04_gulp_build:
env:
LC_ALL: en_US.utf8
LANG: en_US.utf8
command: 'gulp build'
05_collectstatic:
command: 'python manage.py collectstatic --no-input'
06_migrate:
command: "python manage.py migrate"
leader_only: true

26
babybuddy/settings/eb.py Normal file
View File

@ -0,0 +1,26 @@
import os
from .base import * # noqa: F401,F403
DEBUG = os.environ.get('DEBUG', False)
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ['SECRET_KEY']
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}