diff --git a/.ebextensions/log-streaming.config b/.ebextensions/log-streaming.config new file mode 100644 index 0000000000000000000000000000000000000000..84814ea6a0f3aae4d4db4e63bdfd3d7a0c92e8a8 --- /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 0000000000000000000000000000000000000000..44bdf4a1bf957b9230b46726221c027e9f21bab7 --- /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 diff --git a/.elasticbeanstalk/config.default.yml b/.elasticbeanstalk/config.default.yml new file mode 100644 index 0000000000000000000000000000000000000000..a0314b2fe0d02c0ddc106cce23ddb159964eb322 --- /dev/null +++ b/.elasticbeanstalk/config.default.yml @@ -0,0 +1,9 @@ +deploy: + artifact: deployment.zip +global: + 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 + default_region: us-east-1 + sc: git diff --git a/.elasticbeanstalk/config.yml b/.elasticbeanstalk/config.yml deleted file mode 100644 index 9c857cdf7a2d531d0bdbe19b6208ac294796c37e..0000000000000000000000000000000000000000 --- 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 diff --git a/.gitignore b/.gitignore index d09ce83155cf7e9ccf70b1a5878f97730480fda2..f7505603fbb01d7340b340e26025036c1faf062b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ build .env npm-debug.log .idea +.elasticbeanstalk/config.yml diff --git a/Dockerfile b/Dockerfile index e14c39eff418ab5acdf47b72165fb839de2cf3e8..99b91cb086c4e52edb826455172ae776c5deed99 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"] diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json index f62e9284951fc105ce96c9b5ad1036331b116acf..4228bced1de5716fe28057816ba1f97ba1f7c1fc 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 +}