Giter VIP home page Giter VIP logo

webpack-3.8-ssh-solution's Introduction

SSH server with WebPack

This is a solution for front-end developers working with JavaScript. This is basically a self-hosted developer machine synchronized with your local developer environment (e.g. WebStorm or other IDE). Now you don't have to waste your local machine compute power to run WebPack applications.

How it works:

SSH server captures all changes in your local project files and instantly synchronizes them with the project files on you hosting. Webpack configures your project build and displays it in your browser in real time.

Or you can use sshfs to mount a remote file system over SSH.

It consists of:

To launch this solution on Containerum.com sign up with the service, download and use Containerum CLI chkit.

  1. Run the Solution with chkit solution:
$ chkit solution run containerum/webpack-3.8-ssh-solution -e USER=react -e USER_PASS=12345678 -e NAME=websln -e CPU=500m -e RAM=500Mi
  • USER - username,
  • USER_PASS - password,
  • NAME - Solution name
  • CPU, RAM - compute resources for this Solution
  1. Make sure that the Solution is running:
$ chkit get deploy

+-------------------+------+-------------+------+-------+-----+
| NAME              | PODS | PODS ACTIVE | CPU  | RAM   | AGE |
+-------------------+------+-------------+------+-------+-----+
| websln-13k4y      | 1    | 1           | 500m | 500Mi | 22m |
+-------------------+------+-------------+------+-------+-----+
  1. Check through the list of services using chkit get command, mark the port used to connect to the running VM:
$ chkit get svc

+--------------+-----------------+----------+-------------------+-------------+-----+
| NAME         | CLUSTER-IP      | EXTERNAL | HOST              | PORT(S)     | AGE |
+--------------+-----------------+----------+-------------------+-------------+-----+
| websln-13k4y | 10.105.25.198   | true     | x3.containerum.io | 33176:22/TCP| 18m |
+--------------+-----------------+----------+-------------------+-------------+-----+
  1. Connect to the running machine:
$ ssh [email protected] -p33176
  1. Create a working directory:
react@websln:~$ mkdir react

and jump to this directory:

react@websln:~$ cd react
  1. Install a sample react application on your local machine (https://github.com/facebookincubator/create-react-app):
$ npm install -g create-react-app

Note: You'll need to have Node >= 6 on your machine.

and create a new app:

$ create-react-app my-app

$ cd my-app

Open WebStorm on your machine and set the following project settings:

Test the connection:

Upload the selected project folders to the running VM:

7. Run the following commands on the running machine:

react@websln:~$ npm i

react@websln:~$ npm start
  1. To provide access to the launched Solution, we’ll create a service with chkit expose command locally:
chkit expose deploy websln-13k4y -p portname:3000:TCP
  1. Using chkit get get the address and the port to access the running Solution:
$ chkit get svc

+-------------------+-----------------+----------+-------------------+---------------+-----+
| NAME              | CLUSTER-IP      | EXTERNAL | HOST              | PORT(S)       | AGE |
+-------------------+-----------------+----------+-------------------+---------------+-----+
| websln-13k4y      | 10.105.25.198   | true     | x3.containerum.io | 33176:22/TCP  | 22m |
+-------------------+-----------------+----------+-------------------+---------------+-----+
| websln-13k4y-3ac7 | 10.111.121.79   | true     | x2.containerum.io | 19451:3000/TCP| 9s  |
+-------------------+-----------------+----------+-------------------+---------------+-----+

http://x2.containerum.io:19451

  1. All changes that you make in src/App.js are now immediately reflected and can be viewed in your browser at http://x2.containerum.io:19451

webpack-3.8-ssh-solution's People

Contributors

alex4rma avatar iliad avatar kfeofantov avatar margotuleninova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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