Building an app with 2 buildpacks in a Dockerfille

Hello, I have an app with 2 buildpacks, one is the nodejs buildpack that compiles the frontend and the other is the ruby buildpack that builds the rails api. Using a droplet with dokku is easy to manage multiple builpdpacks and everything works, but here in the app platform I needed to create a custom Dockerfile do everything manually and I still cannot receive a live App URL and the build executor(kaniko) is very slow even increasing the machine size.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

With multi-stage builds, you can use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image.

I managed to make it work and the app is live. But, the build is taking around 30 minutes which still is very slow compared with 5 minutes on heroku or dokku in a droplet.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel