Giter VIP home page Giter VIP logo

dokku-vendor's Introduction

Dokku Vendor Server

A simple sinatra app that acts like BUILDPACK_VENDOR_URL and downloads requested file to local and serves the file for dokku deploys. Like ruby binaries, bundler etc.

Blog post: https://medium.com/@mbrain0/how-to-speed-up-dokku-deployments-cc2f42015e55

Why?

I'm deploying Rails apps to dokku-powered DO servers located in AMS1 and SGP1, it takes more than 5 or 6 minutes each deploy because its downloading Ruby binaries each time, even worse connection times out sometimes. Its faster if you serve them from the same server.

Installation

only tested for heroku-buildpack-ruby

  • Deploy this app to your dokku server.
#server
dokku apps:create dokku-vendor
#local
git clone [email protected]:beydogan/dokku-vendor.git
cd dokku-vendor
git remote add dokku dokku@SERVER-IP:dokku-vendor
git push dokku master
  • Create a persistent storage binded to /tmp/dokku-vendor
#server
sudo mkdir /dokku-vendor
sudo chown dokku /dokku-vendor
dokku storage:mount dokku-vendor /dokku-vendor:/tmp/dokku-vendor
  • Use your app url as BUILDPACK_VENDOR_URL to your other apps.
#server
dokku config:set my-rails-app --no-restart BUILDPACK_VENDOR_URL=SERVER-IP:PORT/heroku-buildpack-ruby/

Restricting external access(optional)

You can restrict access from outside of the server by following below. We need to create a nginx config for dokku-vendor app to restrict all IPs except docker subnet(172.17.0.0/16)

#server
mkdir /home/dokku/dokku-vendor/nginx.conf.d/
echo 'allow 172.17.0.0/16; deny all;' > /home/dokku/dokku-vendor/nginx.conf.d/ip_access.conf
chown dokku:dokku /home/dokku/dokku-vendor/nginx.conf.d/ip_access.conf
service nginx reload
  • All done! You can just push your app as usual.

dokku-vendor's People

Contributors

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