Skip to content

Commit

Permalink
deploy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lmeier committed Aug 15, 2019
1 parent a4d81c1 commit 5494897
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ebextensions/django.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: babylproject/babylproject/wsgi.py
WSGIPath: "babylproject/babylproject/wsgi.py"
137 changes: 137 additions & 0 deletions .elasticbeanstalk/babyl-django-env.env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
ApplicationName: babyl DateUpdated: 2019-08-15 03:12:28+00:00
EnvironmentName: babyl-django-env PlatformArn:
arn:aws:elasticbeanstalk:us-west-2::platform/Python 3.6 running on 64bit
Amazon Linux/2.9.1 settings:
AWSEBAutoScalingScaleDownPolicy.aws:autoscaling:trigger:
LowerBreachScaleIncrement: '-1'
AWSEBAutoScalingScaleUpPolicy.aws:autoscaling:trigger:
UpperBreachScaleIncrement: '1'
AWSEBCloudwatchAlarmHigh.aws:autoscaling:trigger:
UpperThreshold: '6000000'
AWSEBCloudwatchAlarmLow.aws:autoscaling:trigger:
BreachDuration: '5'
EvaluationPeriods: '1'
LowerThreshold: '2000000'
MeasureName: NetworkOut
Period: '5'
Statistic: Average
Unit: Bytes
AWSEBLoadBalancerSecurityGroup.aws:ec2:vpc:
VPCId: null
aws:autoscaling:asg:
Availability Zones: Any
Cooldown: '360'
Custom Availability Zones: ''
MaxSize: '4'
MinSize: '1'
aws:autoscaling:launchconfiguration:
BlockDeviceMappings: null
EC2KeyName: aws-eb
IamInstanceProfile: aws-elasticbeanstalk-ec2-role
ImageId: ami-042115ea53ae5c326
InstanceType: t2.micro
MonitoringInterval: 5 minute
RootVolumeIOPS: null
RootVolumeSize: null
RootVolumeType: null
SSHSourceRestriction: tcp,22,22,0.0.0.0/0
SecurityGroups:
awseb-e-vmtywzxjmn-stack-AWSEBSecurityGroup-OVVDBWWHIEGY
aws:autoscaling:updatepolicy:rollingupdate:
MaxBatchSize: '1'
MinInstancesInService: '1'
PauseTime: null
RollingUpdateEnabled: 'true'
RollingUpdateType: Health
Timeout: PT30M
aws:ec2:vpc:
AssociatePublicIpAddress: null
ELBScheme: public
ELBSubnets: null
Subnets: null
aws:elasticbeanstalk:application:
Application Healthcheck URL: ''
aws:elasticbeanstalk:cloudwatch:logs:
DeleteOnTerminate: 'false'
RetentionInDays: '7'
StreamLogs: 'false'
aws:elasticbeanstalk:cloudwatch:logs:health:
DeleteOnTerminate: 'false'
HealthStreamingEnabled: 'false'
RetentionInDays: '7'
aws:elasticbeanstalk:command:
BatchSize: '30'
BatchSizeType: Percentage
IgnoreHealthCheck: 'false'
Timeout: '600'
aws:elasticbeanstalk:container:python:
NumProcesses: '1'
NumThreads: '15'
StaticFiles: /static/=static/
WSGIPath: babylproject/wsgi.py
aws:elasticbeanstalk:container:python:staticfiles:
/static/: static/
aws:elasticbeanstalk:control:
DefaultSSHPort: '22'
LaunchTimeout: '0'
LaunchType: Migration
RollbackLaunchOnFailure: 'false'
aws:elasticbeanstalk:environment:
EnvironmentType: LoadBalanced
ExternalExtensionsS3Bucket: null
ExternalExtensionsS3Key: null
LoadBalancerType: classic
ServiceRole: aws-elasticbeanstalk-service-role
aws:elasticbeanstalk:healthreporting:system:
ConfigDocument:
'{"Version":1,"CloudWatchMetrics":{"Instance":{"CPUIrq":null,"LoadAverage5min":null,"ApplicationRequests5xx":null,"ApplicationRequests4xx":null,"CPUUser":null,"LoadAverage1min":null,"ApplicationLatencyP50":null,"CPUIdle":null,"InstanceHealth":null,"ApplicationLatencyP95":null,"ApplicationLatencyP85":null,"RootFilesystemUtil":null,"ApplicationLatencyP90":null,"CPUSystem":null,"ApplicationLatencyP75":null,"CPUSoftirq":null,"ApplicationLatencyP10":null,"ApplicationLatencyP99":null,"ApplicationRequestsTotal":null,"ApplicationLatencyP99.9":null,"ApplicationRequests3xx":null,"ApplicationRequests2xx":null,"CPUIowait":null,"CPUNice":null},"Environment":{"InstancesSevere":null,"InstancesDegraded":null,"ApplicationRequests5xx":null,"ApplicationRequests4xx":null,"ApplicationLatencyP50":null,"ApplicationLatencyP95":null,"ApplicationLatencyP85":null,"InstancesUnknown":null,"ApplicationLatencyP90":null,"InstancesInfo":null,"InstancesPending":null,"ApplicationLatencyP75":null,"ApplicationLatencyP10":null,"ApplicationLatencyP99":null,"ApplicationRequestsTotal":null,"InstancesNoData":null,"ApplicationLatencyP99.9":null,"ApplicationRequests3xx":null,"ApplicationRequests2xx":null,"InstancesOk":null,"InstancesWarning":null}}}'
HealthCheckSuccessThreshold: Ok
SystemType: enhanced
aws:elasticbeanstalk:hostmanager:
LogPublicationControl: 'false'
aws:elasticbeanstalk:managedactions:
ManagedActionsEnabled: 'false'
PreferredStartTime: null
aws:elasticbeanstalk:managedactions:platformupdate:
InstanceRefreshEnabled: 'false'
UpdateLevel: null
aws:elasticbeanstalk:monitoring:
Automatically Terminate Unhealthy Instances: 'true'
aws:elasticbeanstalk:sns:topics:
Notification Endpoint: null
Notification Protocol: email
Notification Topic ARN: null
Notification Topic Name: null
aws:elasticbeanstalk:xray:
XRayEnabled: 'false'
aws:elb:healthcheck:
HealthyThreshold: '3'
Interval: '10'
Target: TCP:80
Timeout: '5'
UnhealthyThreshold: '5'
aws:elb:listener:80:
InstancePort: '80'
InstanceProtocol: HTTP
ListenerEnabled: 'true'
ListenerProtocol: HTTP
PolicyNames: null
SSLCertificateId: null
aws:elb:loadbalancer:
CrossZone: 'true'
LoadBalancerHTTPPort: '80'
LoadBalancerHTTPSPort: 'OFF'
LoadBalancerPortProtocol: HTTP
LoadBalancerSSLPortProtocol: HTTPS
SSLCertificateId: null
SecurityGroups: sg-0bf1a5ad07d518375
aws:elb:policies:
ConnectionDrainingEnabled: 'true'
ConnectionDrainingTimeout: '20'
ConnectionSettingIdleTimeout: '60'
aws:rds:dbinstance:
DBAllocatedStorage: '10'
DBDeletionPolicy: Snapshot
DBInstanceClass: db.t2.micro
DBSnapshotIdentifier: null
MultiAZDatabase: 'false'
25 changes: 25 additions & 0 deletions .elasticbeanstalk/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
branch-defaults:
master:
environment: babyl-django-env
group_suffix: null
environment-defaults:
babyl-django-env:
branch: null
repository: null
babylproject-dev:
branch: null
repository: null
global:
application_name: babylproject
branch: null
default_ec2_keyname: aws-eb
default_platform: Python 3.6
default_region: us-west-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
Binary file modified babylproject/__pycache__/settings.cpython-37.pyc
Binary file not shown.
11 changes: 6 additions & 5 deletions babylproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY')
SECRET_KEY = '@lui4d_$9_*c+*+(+0@$0rngm(7n=8n-^!pmg2kp^)a^sw4474'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', default=False, cast=bool)

ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
ALLOWED_HOSTS = [.localhost,127.0.0.1, http://babyl-django-env.mijbfpttig.us-west-2.elasticbeanstalk.com/, www.babyl.online]
# ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())


if 'RDS_DB_NAME' in os.environ:
Expand All @@ -46,9 +47,9 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'iotd',
'USER': 'iotd',
'PASSWORD': 'iotd',
'NAME': 'psdb',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
Expand Down

0 comments on commit 5494897

Please sign in to comment.