From a00e624ba3f2968a495e3e0bb6a9ce55cca4ed06 Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Mon, 22 Jan 2018 23:38:46 -0500 Subject: [PATCH 1/6] Add default config.yml --- .elasticbeanstalk/config.default.yml | 9 +++++++++ .elasticbeanstalk/config.yml | 12 ------------ 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 .elasticbeanstalk/config.default.yml delete mode 100644 .elasticbeanstalk/config.yml diff --git a/.elasticbeanstalk/config.default.yml b/.elasticbeanstalk/config.default.yml new file mode 100644 index 00000000..4fd401ad --- /dev/null +++ b/.elasticbeanstalk/config.default.yml @@ -0,0 +1,9 @@ +deploy: + artifact: deployment.zip +global: + application_name: Buildings + default_ec2_keyname: EastCoastBPKey + default_platform: arn:aws:elasticbeanstalk:us-east-1::platform/Docker running on + 64bit Amazon Linux/2.8.1 + default_region: us-east-1 + sc: git diff --git a/.elasticbeanstalk/config.yml b/.elasticbeanstalk/config.yml deleted file mode 100644 index 9c857cdf..00000000 --- a/.elasticbeanstalk/config.yml +++ /dev/null @@ -1,12 +0,0 @@ -branch-defaults: - $GIT_BRANCH: - environment: $EB_ENV -global: - application_name: $EB_APP - default_ec2_keyname: EastCoastBPKey - default_platform: 64bit Amazon Linux 2015.09 v2.0.8 running Docker 1.9.1 - default_region: us-east-1 - profile: null - sc: git -deploy: - artifact: deployment.zip \ No newline at end of file -- GitLab From eb7982a9551bdf0f4b90a615989c4fbd6761e604 Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Tue, 23 Jan 2018 09:20:58 -0500 Subject: [PATCH 2/6] Update dockerfile --- Dockerfile | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index e14c39ef..99b91cb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,34 @@ -FROM ubuntu +FROM node:8 + +ARG DOMAIN ENV CODEROOT=/home/docker/code # Log enironment variables. -ENV NGINXERR=/var/log/nginx.err.log -ENV NGINXREQ=/var/log/nginx.req.log - -# Custom environment variables. These change from project to project. -ARG DOMAIN -ENV DOMAIN=${DOMAIN} +ENV NGINXERR=/var/log/app/nginx.err.log +ENV NGINXREQ=/var/log/app/nginx.req.log # Install dependencies. -RUN \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - nginx supervisor \ - build-essential git && \ - rm -rf /var/lib/apt/lists/* +RUN apt-get -qq update && apt-get install -y \ + build-essential \ + curl \ + nginx \ + supervisor \ + && rm -rf /var/lib/apt/lists/* # Put the code somewhere. ADD . $CODEROOT/ +WORKDIR $CODEROOT + +RUN npm install +RUN npm run build # Create the www user. RUN useradd -ms /bin/bash www # Create the log files. -RUN touch $NGINXERR && touch $NGINXREQ +RUN mkdir /var/log/app/ && \ + touch $NGINXERR && touch $NGINXREQ # Copy the configuration files, inserting environment variables along the way. RUN \ @@ -40,4 +43,4 @@ RUN \ replace_vars $CODEROOT/config/supervisor.conf /etc/supervisor/conf.d/supervisor.conf EXPOSE 80 -CMD ["supervisord", "-n"] \ No newline at end of file +CMD ["supervisord", "-n"] -- GitLab From 013f179acd8c5cb4a290b07cf6f7b504ea54112c Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Tue, 23 Jan 2018 09:46:32 -0500 Subject: [PATCH 3/6] Remove docker hub from dockerrun --- Dockerrun.aws.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json index f62e9284..4228bced 100644 --- a/Dockerrun.aws.json +++ b/Dockerrun.aws.json @@ -1,9 +1,5 @@ { "AWSEBDockerrunVersion": "1", - "Authentication": { - "Bucket": "dockerauth.blocpower.org", - "Key": "$DOCKER_REPO.json" - }, "Image": { "Name": "blocp/$DOCKER_REPO" }, @@ -13,4 +9,4 @@ "ContainerPort": "80" } ] -} \ No newline at end of file +} -- GitLab From 59de9bae849079df26b62b272fcdede77775d2dc Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Tue, 23 Jan 2018 14:34:35 -0500 Subject: [PATCH 4/6] Add config.yml to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d09ce831..f7505603 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ build .env npm-debug.log .idea +.elasticbeanstalk/config.yml -- GitLab From 73bd377a8b50ef3f5fc5dbe46bdbd770333d5fd9 Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Tue, 23 Jan 2018 15:08:24 -0500 Subject: [PATCH 5/6] Rename application name --- .elasticbeanstalk/config.default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.elasticbeanstalk/config.default.yml b/.elasticbeanstalk/config.default.yml index 4fd401ad..a0314b2f 100644 --- a/.elasticbeanstalk/config.default.yml +++ b/.elasticbeanstalk/config.default.yml @@ -1,7 +1,7 @@ deploy: artifact: deployment.zip global: - application_name: Buildings + application_name: Dashboard default_ec2_keyname: EastCoastBPKey default_platform: arn:aws:elasticbeanstalk:us-east-1::platform/Docker running on 64bit Amazon Linux/2.8.1 -- GitLab From 513d6444a7f395ae1ced3a428d4983d247b530e5 Mon Sep 17 00:00:00 2001 From: Alessandro DiMarco Date: Tue, 23 Jan 2018 17:32:05 -0500 Subject: [PATCH 6/6] Add .ebextensions --- .ebextensions/log-streaming.config | 5 +++++ .ebextensions/managed-platform-update.config | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .ebextensions/log-streaming.config create mode 100644 .ebextensions/managed-platform-update.config diff --git a/.ebextensions/log-streaming.config b/.ebextensions/log-streaming.config new file mode 100644 index 00000000..84814ea6 --- /dev/null +++ b/.ebextensions/log-streaming.config @@ -0,0 +1,5 @@ +option_settings: + aws:elasticbeanstalk:cloudwatch:logs: + StreamLogs: true + DeleteOnTerminate: false + RetentionInDays: 180 diff --git a/.ebextensions/managed-platform-update.config b/.ebextensions/managed-platform-update.config new file mode 100644 index 00000000..44bdf4a1 --- /dev/null +++ b/.ebextensions/managed-platform-update.config @@ -0,0 +1,7 @@ +option_settings: + aws:elasticbeanstalk:managedactions: + ManagedActionsEnabled: true + PreferredStartTime: "Mon:07:00" + aws:elasticbeanstalk:managedactions:platformupdate: + UpdateLevel: minor + InstanceRefreshEnabled: false -- GitLab