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

browlciba's avatar

Deploying Laravel Mix using Docker?

I'm currently trying to move an existing Laravel app onto Docker containers using docker-compose. All good so far, except I'm stuck on how to run the npm install and npm run mix steps. I've got a node.js image and I think I should just have to mount the application root directory as a bind-mount, run the npm scripts, and then the built files should be dumped into the application directory on the host, thanks to the bind mount, right?

However, whatever I try, I don't seem to even get the node_modules directory on my host file system. I just get the "node js container exited with status code 0" message and nothing else seems to change.

Rather than waste time posting my Docker files and asking for critique, I guess there must be people who do this frequently, given the popularity of Laravel and of Docker. How do you manage this step? How do you run your Javascript build step using containers? What's the best practice?

0 likes
2 replies
browlciba's avatar

I'm currently trying to move an existing Laravel app onto Docker containers using docker-compose. All good so far, except I'm stuck on how to run the npm install and npm run mix steps. I've got a node.js image and I think I should just have to mount the application root directory as a bind-mount, run the npm scripts, and then the built files should be dumped into the application directory on the host, thanks to the bind mount, right?

However, whatever I try, I don't seem t https://vidmate.onl/ o even get the node_modules directory on my host file system. I just get the "node js container exited with status code 0" message and nothing else seems to change.

Rather than waste time posting my Docker files https://mobdro.onl/ and asking for critique, I guess there must be people who do this frequently, given the popularity of Laravel and of Docker. How do you manage this step? How do you run your Javascript build step using containers? What's the best practice?

issue got solved!!

Please or to participate in this conversation.