Skip to content

Instantly share code, notes, and snippets.

@adamgavlak
Created December 1, 2018 11:20
Show Gist options
  • Save adamgavlak/bbe1c203a9e213d861a190c22fb1096a to your computer and use it in GitHub Desktop.
Save adamgavlak/bbe1c203a9e213d861a190c22fb1096a to your computer and use it in GitHub Desktop.
Basic dokku installation
# Create a Dokku app and addons
#------------------------------
## Go to http://SERVER_IP and add a IP address (if you don't it seems to go weird: use a junk one if needed)
dokku apps:create APP_NAME
## Add postgresql and link it to the application
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
dokku postgres:create APP_NAME-db
dokku postgres:link APP_NAME-db APP_NAME
# Import database dump to current database
dokku postgres:import APP_NAME-db < db.dump
## Increase the timeout as initial setup can take a while
dokku config:set APP_NAME CURL_CONNECT_TIMEOUT=30 CURL_TIMEOUT=300
dokku config:set APP_NAME RAILS_ENV=production RAILS_MASTER_KEY=project_master_key RAILS_SERVE_STATIC_FILES=true
dokku config APP_NAME
# Add git remote and deploy
#--------------------------
## Remember to checkin the new files above!
git remote add dokku dokku@SERVER_IP:APP_NAME
git push dokku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment