Skip to content

mengzhen94/nightlife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nightlife Coordination App

Description

  • Developed Nightlife Bar App using AngularJS, Meteor.js framework and MongoDB database
  • Implemented club search via Yelp API. Allowed users to view all the bars in the area, mark or unmark a bar as one’s favorite
  • Dockerized and deployed using AWS EC2 Container Service

Dockerize and Deploy to AWS

Clone and Build APP

$ mkdir nightlife && cd nightlife
$ git clone https://github.com/mengzhen94/nightlife.git

Install dependencies before meteor build, or we'll get error (Unable to resolve some modules)

$ npm install
$ meteor build ../build

Unzip build file and change the directory to bundle (bundle is the root directory of source code)

$ cd ../build && tar -zxvf nightlife.tar.gz && cd bundle

Write Dockerfile

In bundle folder, create empty Dockerfile (touch is the easiest way to create new, empty file)

$ touch Dockerfile

Here is the Dockerfile source code

FROM node:4.4.7
COPY . /bundle
RUN (cd /bundle/programs/server && npm install)
ENV PORT=80
ENV MONGO_URL=###
EXPOSE 80
CMD node /bundle/main.js

Docker Build and Run

Yelp environment variables are in Settings.json, cat and assign it to METEOR_SETTINGS

$ docker build -t nightlife .
$ docker run -d -e ROOT_URL=http://yourapp.com -e METEOR_SETTINGS="$(cat ../../nightlife/settings.json)" -p 7000:80 nightlife

Deploy on AWS

Follow the tutorial Deploying a MeteorJS app to ECS. Make sure set Environment Variables:

key: ROOT_URL
value: http://tempdomain.com
key: PORT
value: 80
key: MONGO_URL
value: xxx
key: METEOR_SETTINGS
value: {ConsumerKey:xxx, ConsumerSecret:xxx, Token: xxx, TokenSecret:xxx}

BTW, don't worry if Environment Variables are not correct, we can create new task revision, update settings, stop the running task and add the new revision taks to Cluster

DONE!

🎉🎉🎉🎉

About

http://ec2-34-205-26-141.compute-1.amazonaws.com/ Dockerized and deployed using AWS EC2 Container Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published