diff --git a/.ebextensions/babybuddy.config b/.ebextensions/babybuddy.config new file mode 100644 index 00000000..4f008a54 --- /dev/null +++ b/.ebextensions/babybuddy.config @@ -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 diff --git a/babybuddy/settings/eb.py b/babybuddy/settings/eb.py new file mode 100644 index 00000000..084f604e --- /dev/null +++ b/babybuddy/settings/eb.py @@ -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'], + } +}