It's a list of awesome Persian entrepreneurs doing great work around the world. It's inspired by Beggars.co idea. We didn't know PHP so we rewrote the whole thing in Ruby on Rails.
gem install foreman
bundle install
echo "RACK_ENV=development" >> .env
echo "PORT=3000" >> .env
rake db:create db:migrate
foreman start
You can import a list of people by rake db:person:import
You can also wipe off the database of 'persons' by rake db:person:clear
You need to remove therubyracer
and execjs
gems. Heroku doesn't need a js runtime.
Login to https://dashboard.abarcloud.com/console/command-line to download the CLI.
Get your CLI login token from https://dashboard.abarcloud.com/console/command-line
Login to CLI:
oc login https://dashboard.abarcloud.com --token=<my_token>
Create a new project:
oc new-project my-new-project
Create the app, using Docker:
oc new-app --strategy=docker https://github.com/KamvaHQ/persianpreneur.git
Patch the build configuration so it doesn't use any base images, and creates a new image from scratch:
oc patch bc/persianpreneur -p '{"spec":{"strategy":{"dockerStrategy":null}}}'
Start a new build as we changed the build config above:
oc start-build persianpreneur
Create a route so the service is exposed externally:
oc expose svc/persianpreneur
If you want HTTPS:
oc patch route/persianpreneur -p '{"spec":{"tls":{"termination":"edge","insecureEdgeTerminationPolicy":"Redirect"}}}'
Show the route URL:
oc get routes
Get the build logs, once it's finished, it'll trigger a deployment and you can browse to the route:
oc logs -f bc/persianpreneur
Alternatively, you can use nodejs instead of execjs
. It's was just more convenient to add a gem rather than asking all to install nodejs.
Follow this guide!