Deployment of Project COJ

COJ

This project is to build a web app that people can add their coding problems and edit the code on the same page just like google doc.
Click here to see the demo.
You can share the problem url with others so that everyone who has the link can editor on the same page.

Content

    1. Setup AWS EC2 ubuntu 16.04
    1. Config Linux environment
    1. Write a shell script to automate a build and deployment

1. Setup AWS EC2 ubuntu 16.04

Read AWS EC2 linux instance carefully!!!

  • figure out the def. of instance, IAM, security group etc
  • read the Doc recursively until you understanding depends

Some key points

  • inbound rules security group
  • open 2 IAM for backup
  • open 2 Linux instance for backup

2. Config Linux environment

  • AWS Linux 16.04
  • (optioinal)Local Linux

3. Write a shell script to automate a build and deployment

shell script

If not familar with shell, read ref just 1~2 hour, making you life easy.
Then Try to writing or imitating on some business shell, like /bin under JetBrain

Get repo from github

git clone https://github.com/mwangxx0129/COJ.git

Run on background

$ [sudo] npm install forever -g
forever start app.js

Set up environment on Linux 16.04

How do I get set up?

update

sudo apt-get update

Install Terminator

sudo apt-get install terminator

Install NodeJs: (root)

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

sudo apt-get install -y nodejs

Install Nodemon

sudo npm install -g nodemon

Install git

sudo apt-get install git

Install angular/cli

sudo npm install -g @angular/cli

Install Redis

wget http://download.redis.io/releases/redis-3.2.6.tar.gz

tar xzf redis-3.2.6.tar.gz

cd redis-3.2.6

make

sudo make install

cd utils

sudo ./install_server.sh

Install python 2.7: This is installed already in Ubuntu

Install pip:

(sudo apt-get update)

sudo apt install python-pip

sudo pip install Flask

Install Docker:

curl -fsSL https://get.docker.com/ | sh

Setup docker permission:

sudo usermod -aG docker $(whoami)

(you need to logout and login again after set permission)

To start docker when the system boots: sudo systemctl enable docker

Install Nginx

(For ubuntu 16.04) Add following two lines into /etc/apt/sources.list

deb http://nginx.org/packages/ubuntu/ xenial nginx

deb-src http://nginx.org/packages/ubuntu/ xenial nginx

Then run:

sudo apt-get update

sudo apt-get install nginx

Trouble shooting

redis

sudo apt-get install make

sudo apt-get install build-essential

TODO

  • deploy again on both aws and local

  • add config for ip port

  • search bar on UI

  • count of session on UI

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Docker — 云时代的程序分发方式 要说最近一年云计算业界有什么大事件?Google Compute Engi...
    ahohoho阅读 15,619评论 15 147
  • 注:原文地址:http://severalnines.com/blog/mysql-docker-containe...
    空乱木阅读 6,001评论 0 7
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,923评论 18 139
  • 1****、前言进入云计算的时代,各大云提供商AWS,阿里云纷纷推出针对Docker的服务,现在Docker是十分...
    燕京博士阅读 755评论 0 0
  • 第一本Docker书 自动精简配置: thin-provisioning加载device-mapper模块sudo...
    崩芭大酱阅读 2,202评论 0 16