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

nadavsheer's avatar

How to set up a docker-compose and Dockerfile to deploy a Laravel app?

I recently finished developing a Laravel 9 app, using wsl2 and sail, just like I was told in the Laravel documentation. Since it’s my first time deploying to live ever, I ran into some differences with local and production files such as .env, docker-compose.yml and Dockerfile. I tried using guides and tutorials but I can’t seem to make sense as to how to make it work. I have a DigitalOcean droplet with a non-root user with sudo privileges, since I used some kind guides from DigitalOcean. After finishing with the Docker and docker-compose installation, I tried to clone my app and run it like I do locally, and nothing happened. I realize I can’t use sail on the server, but what is the correct way to make it work? All three local files (.env, docker-compose.yml and Dockerfile) were never edited

0 likes
2 replies
nadavsheer's avatar

@axtg As I mentioned - I know that sail isn't the use case in production. Plus I ran into this guide before... I go to forums and ask questions because I can't get answers from these static guides...

Please or to participate in this conversation.