GithubHelp home page GithubHelp logo

deploying-an-application-to-digital-ocean-jsheroes-workshop's Introduction

Deploying an Application to Digital Ocean (JSHeroes Workshop)

This a test repo that we deployed on our workshop (https://www.meetup.com/jsheroes/events/268349025/). I has a frontend application and an api.

What did we do:

  1. Createad out Digital Ocean account

  2. Created our VM / Droplet with Ubuntu 18, standard plan and 5$ per month (enough for our testing porpouse ). Use this link https://m.do.co/c/34f48445bac1 to get 100$ credit for 60 days.

  3. added our SSH key to Digital Ocean

  4. Some of us used launch console to login in the droplet (remember user is root, you can get your password by reseting it)

  5. Cloned this repo

  6. Installed node with a specific version: bash curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - and bash apt install nodejs

  7. We blocked all the incomming network request using ufw (Uncomplicated Firewall), remember by default its inactive:

    • ufw status (checks the status)
    • ufw default deny incoming
    • ufw default allow outgoing
    • ufw allow ssh // do this before enabling the firewall
    • ufw enable
    • ufw allow 8080 // how to open ports to accept incoming requests
    • ufw allow 3000 // don't forget to open the port for the api
  8. Changed the api link in the frontend repo to use the ip of the server(use your custom domain name if you will have one attached to droplet) and rebuild the project

  9. Installed pm2 to help us manage processed

    • npm install pm2 -g
    • pm2 start node index.js --name frontend // starting the small express server that servers the frontend build dist
    • pm2 start npm -- start // the other option to start with an npm script, we used this for starting the api and our test database (json-server)
    • pm2 stop frontend
    • pm2 status
    • pm2 logs
  10. Reminder... don't forget to delete your droplets if you don't use them. Else you will have to pay for them.

deploying-an-application-to-digital-ocean-jsheroes-workshop's People

Contributors

danielmocan avatar dependabot[bot] avatar

Watchers

James Cloos 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.