Code Monkey home page Code Monkey logo

anu's Introduction

Ubuntu 20.04 in Heroku

▶️🐳 This is a guide on how to use Ubuntu on Heroku.

Note that this guide does not use pure Ubuntu from docker rather uses a ubuntu based on OS made by Heroku itself

Usage

Here's the steps to use Ubuntu on Heroku:

  1. Loging into Heroku Login:
$ heroku login -i
heroku: Enter your login credentials
Email: [email protected]
Password: ***************
Two-factor code: ********
Logged in as [email protected]
  1. Loging into Heroku containers:
$ heroku container:login

Login Succeeded
  1. Creating a Heroku Create: (Not requied if you aleardy have a app)
$ heroku create
Creating safe-journey-10471... done, stack is heroku-18
https://safe-journey-10471.herokuapp.com/ | https://git.heroku.com/safe-journey-10471.git
  1. Pushing the Heroku App:
$ heroku container:push worker -a safe-journey-10471
=== Building worker ...
...
...
Your image has been successfully pushed. You can now release it with the 'container:release' command.

Note: here we are using worker and not web process id because web require a listening port, we are also using the app from berfore with the -a parameter. You should use your app name created

  1. Releaseing the Heroku App:
$ heroku container:release worker -a safe-journey-10471
Releasing images worker to safe-journey-10471... done
  1. Scaling your app to work as a worker
$ heroku ps:scale worker=1 
Scaling dynos... done, now running worker at 1:Free
  1. Checking if the worker in working:
$ heroku ps -a safe-journey-10471
Free dyno hours quota remaining this month: 549h 52m (99%)
Free dyno usage for this app: 0h 0m (0%)
...
...
=== worker (Free): /bin/sh -c bash\ heroku-exec.sh (1)
worker.1: up 2020/01/19 04:35:29 -0800 (~ 1m ago)
  1. Shell into your app!
$ heroku ps:exec -a safe-journey-10471 -d worker.1
Running this command for the first time requires a dyno restart.
Do you want to continue? [y/n]: y
Initializing feature... done
Restarting dynos... done
Waiting for worker.1 to start... done
Establishing credentials... done
Connecting to worker.1 on ⬢ safe-journey-10471...
/ $ uname -a
Linux c3ce7420-4538-446e-912f-67168232773f 4.4.0-1057-aws #61+hf245703v20191104b1-Ubuntu SMP Mon Nov 4 15:32:25 UTC 2019
 x86_64 x86_64 x86_64 GNU/Linux
/ $

Note: -d parameter has to be put after -a parameter or the -d parameter will not be detected.

And there you go, now you have your own Heroku container running Ubuntu!

anu's People

Contributors

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