Skip to content

Instantly share code, notes, and snippets.

@technicalbirdVayuz
Last active December 15, 2018 09:41
Show Gist options
  • Select an option

  • Save technicalbirdVayuz/bc6510365436d72e5464096a086f6837 to your computer and use it in GitHub Desktop.

Select an option

Save technicalbirdVayuz/bc6510365436d72e5464096a086f6837 to your computer and use it in GitHub Desktop.

Revisions

  1. technicalbirdVayuz revised this gist Dec 15, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion app.config
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ option_settings:
    value: http://elasticbitovn.ap-south-1.elasticbeanstalk.com

    - option_name: MONGO_URL
    value: mongodb://bitovn:bitovn1@ds121371.mlab.com:21371/bitovn_elastic
    value: mongodb://------:-------@-------.mlab.com:21371/---------------

    - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: ProxyServer
  2. technicalbirdVayuz created this gist Dec 15, 2018.
    18 changes: 18 additions & 0 deletions app.config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    option_settings:

    - option_name: PORT
    value: 8081

    - option_name: ROOT_URL
    value: http://elasticbitovn.ap-south-1.elasticbeanstalk.com

    - option_name: MONGO_URL
    value: mongodb://bitovn:bitovn1@ds121371.mlab.com:21371/bitovn_elastic

    - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: ProxyServer
    value: nginx

    - namespace: aws:elasticbeanstalk:container:nodejs:staticfiles
    option_name: /public
    value: /public
    10 changes: 10 additions & 0 deletions change_permissions
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    files:
    "/opt/elasticbeanstalk/hooks/appdeploy/pre/00_set_tmp_permissions.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
    #!/usr/bin/env bash
    chown -R ec2-user /tmp
    chown -R $USER:$(id -gn $USER) /tmp/.config
    chown -R nodejs:nodejs /tmp/.npm
    25 changes: 25 additions & 0 deletions failed_to_install_npm.config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    packages:
    yum:
    gcc: []
    make: []
    openssl-devel: []
    libxml2: []
    libxml2-devel: []
    files:
    "/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" :
    mode: "000775"
    owner: root
    group: root
    content: |
    #!/bin/bash
    function error_exit
    {
    eventHelper.py --msg "$1" --severity ERROR
    exit $2
    }

    export HOME=/home/ec2-user # ADDED EXPORT COMMAND
    echo "export home" # JUST FOR REMARK

    OUT=$(/opt/elasticbeanstalk/containerfiles/ebnode.py --action npm- install 2>&1) || error_exit "Failed to run npm install. $OUT" $?
    echo $OUT