GithubHelp home page GithubHelp logo

go-learn-deploy's Introduction

Notes

  • main/master branch is for EC2 only

  • rds-connection branch is for EC2 and RDS simultaneously

Steps

  1. Open terminal (You can use CMD if using windows)

  2. Connect to instance (Different based on instance configure)

    Formula command

    ssh -i "public_key" username@Public_IPv4_DNS
    

    Example command

    ssh -i "Haikal_18.pem" [email protected]
    
  3. Install docker, docker-compose, git, and nginx

    Get into super user mode

    sudo su
    

    Update package

    yum update -y
    

    Install git

    yum install git -y
    
    git -v
    

    Install docker

    yum install -y docker
    
    docker -v
    

    Install docker-compose

    curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/bin/docker-compose
    
    docker-compose -v
    

    Install nginx

    amazon-linux-extras install nginx1.12
    
    nginx -v
    
  4. Clone repository

    git clone https://github.com/hklfach/go-learn-deploy
    
  5. Configure nginx for reverse proxy

    Go to nginx directory

    cd /etc/nginx/
    

    Edit nginx.conf using nano

    nano nginx.conf
    

    Comment root variable in line 42 and add proxy_pass inside location {}

    ...
     server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        # root         /usr/share/nginx/html;
    
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
    
        location / {
                proxy_pass http://127.0.0.1:8080;
        }
    
        error_page 404 /404.html;
            location = /40x.html {
        }
    
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
    ...
    
  6. Use docker and nginx

    Start docker

    service docker start
    

    Get into go-learn-deploy directory

    cd go-learn-deploy
    

    Use docker compose

    docker-compose up -d
    

    Start nginx

    systemctl start nginx
    
  7. Open program in public IP Adress

    Example

    http://13.229.134.70/
    

go-learn-deploy's People

Contributors

haikalfachri avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.