Code Monkey home page Code Monkey logo

sshmanager's Introduction

Updated: 2019/11/23

Version: 1.0

Author: Dao Ngoc Lam

Note: Trong trường hợp muốn sử dụng container để deploy web frontend và web backend, vui lòng bỏ comment các component web-frontend và web-backend và thêm vào thành phần ssh-node dựa trên web-frontend và web-backend

Bước 1: Khởi động database container

Tại thư mục chứa file docker-compose, chạy command:

docker-compose up

Hoặc để chạy ẩn docker-compose, chạy một trong 2 lệnh sau

docker-compose up -d 

hoặc

docker-compose start

Bước 2: Tạo database

Note:

  1. Chỉ cần làm bước này lần đầu tiên, hoặc trong trường hợp database đã bị xóa
  2. Trong trường hợp chưa cài đặt mysql trong máy, có thể sử dụng admnider đã được cài sẵn trong container tại địa chỉ: 172.10.10.11:8080 hoặc localhost/8080 (đã được mount với port của local)

Truy cập vào database với các thông số sau:

server: 172.10.10.10
username: root
password: mypasswd

tạo database có tên:

db: mydb

Bước 3: Cấu hình file .env

Cấu hình theo các thôg số sau:

DB_HOST = ""
DB_USER = ""
DB_PASSWD = ""
DB_NAME = ""

AWS_ACCESS_KEY_ID = ""
AWS_SECRET_ACCESS_KEY = ""
AWS_REGION = ""

DYNAMO_TABLE = ""

Note: với các thông số về kết nối MySQL có thể lấy từ bước thứ 2

Bước 4: Khởi động

Chạy các câu lệnh sau tại thư mục sshmanager:
Khởi động web server

cd server
node index.js

Khởi động ssh node

cd ssh-node
node SshClient.js

Khởi động web frontend

cd client
npm start

Lưu ý khác:

  1. Các file hoặc folder quan trọng chạy trong docker đã được mount với file/folder quan trọng trên local. Vì vậy, không cần lo lắng việc sau dữ liệu bị mất sau khi tắt container
  2. địa chỉ IP của container đã được cài đặt cố định, vì vậy không cần thay đổi cài đặt trong file .env khi khởi động lại container
  3. Để tiết kiệm tài nguyên máy, có thể tắt container sau khi sử dụng bằng command
    docker-compose down -d
    
    hoặc chỉ để tắt tạm thời (container sẽ khởi động lại sau khi restart máy)
    docker-compose down
    

sshmanager's People

Contributors

liamhubian avatar simpa407 avatar trungdinh98 avatar

Stargazers

 avatar  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.