Skip to main content

Posts

Showing posts from November, 2020

Deploy Rails Application on Amazon Elastic Bean

First Sign into the consle of the Amazon Web Services ( AWS ) and  In the Navigation pane Select ElasticBean Click on Applications and then on the Create Applicataion button and  Name the appliation and click on Create The will create the Application  Now you need to Create the environment. You need to select the Ruby version. I selected 2.6 It is must same as the the Ruby version in your local and the Ruby version on the AWS must be same otherwise it will fail while deploying Also you need check the puma version it must also be that of the AWS.  The PUma version is mentioned in the GEM file of the Rails app. . Leave the rest and now click on Create  Deploying the Application. Go to your Local folder of the Rails project and run eb init on the root of the app. This will create ebbeanstalk environment folder  You will be prompted to use Code Commit  Choose Yes Then run git add  Then you will be prompted to create a repo . Create a new one  Then select the master branch as shown in the i

Amazon Web services elastic bean Django (Python) + ReactJS in production in Amazon Web Services, Elastic Bean, S3

  Merging Django & React App Production   React App Scenario 1.     In the .env file ·         Add PUBLIC_URL = [s3 url] This will create absolute path of the CSS and JS files in the index.html of the production build, by default it will be relative links. S3 URL is the Amazon S3 Bucket URL 2.      Run npm run build at the root of the React app. This will create a production Build Django App Scenario 1.      pip3 install django-storages (third party app for storage for Django in S3 ) 2.      Add the following in the settings.py ·          Debug = False ·          Add ‘'storages'’ in the INSTALLED_APPS Mention the AWS OPTIONS ·          AWS_S3_REGION_NAME   = "us-east-1" ·          AWS_ACCESS_KEY_ID = "DXS6TUMYE4O3OR" ·          AWS_SECRET_ACCESS_KEY = "rcDeN6/Bxb8R01aRRviD2QP/a" ·          AWS_STORAGE_BUCKET_NAME   = 'lithific-s3-storage' ·          STATICFILES_DIRS = [ os.path.join(BASE_DIR, &q