Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jeef's avatar
Level 1

Deploying on Heroku with Laradock

Hi all,

I have been searching high and low for over a week now and cannot for the life of me find any helpful guides on deploying a production application to Heroku if I used LaraDock for my development environment.

Everything I find either is designed for deploying on Heroku if you have a single Dockerfile, but this setup is not the same as the LaraDock setup where I have a laradock subdirectory in my app with my docker-compose.yml and a bunch of additional subdirs with their own Dockerfiles.

Help! I'm at my wit's end with this stuff, beyond exasperated. I switched from Homestead over to Docker because development is a breeze and the overhead is low, but this lack of guidance around deploying is making me regret my decision. It's too late to go back, so I need to find some help.

Does anyone have any experience deploying a containerized Laravel application to Heroku with a LaraDock configuration? Please don't direct me to the Heroku official docs, it is not helpful for the type of file-structure that LaraDock uses. I've read over the following documents a dozen times:

https://devcenter.heroku.com/articles/build-docker-images-heroku-yml https://devcenter.heroku.com/articles/local-development-with-docker-compose#pushing-your-containers-to-heroku https://devcenter.heroku.com/articles/container-registry-and-runtime

and I'm either too dense to understand how these pertain to a LaraDock setup or I'm a sitting duck and am going to have to completely upend our architecture and switch to AWS or back to a Homestead environment.

0 likes
2 replies
jeef's avatar
Level 1

So, I realize that I didn't really ask a question other than "does anyone have experience with this", which isn't particularly helpful.

Here's where I'm struggling. I have a heroku.yml file created in the root directory of my application. According to the Heroku documentation, I should point build.docker.web to some specific Dockerfile (https://devcenter.heroku.com/articles/build-docker-images-heroku-yml). However, my app uses multiple Dockerfiles and I'm not sure which one specifically I'm supposed to point build.docker.web to?

I run my dev environment with docker-compose using the docker-compose up -d nginx redis postgres command for LaraDock, which then creates the following containers:

laradock_redis

laradock_nginx

laradock_postgres

laradock_php-fpm

laradock_workspace

docker:dind

I understand from Heroku docs that I should not include Postgres or Redis in my docker build, as I'll be using Heroku add-ons for those. However, how do I include all the other containers in my heroku.yml? Which container's Dockerfile do I need to point build.docker.web to? Am I totally clueless and embarassing myself? I didn't expect to not be able to utilize docker-compose with Heroku which is really throwing me for a loop.

Any guidance or if you have an example heroku.yml you've set up for LaraDock that you could share would be much appreciated!

1 like
ali2535's avatar

@jeef Hi, Did you find its solution? I have also the same situation. I want to deploy with my docker-compose that consists the database, redis and laravel container.

Please or to participate in this conversation.