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

csaba_szekely's avatar

Laravel backend & Vue3 frontend with Sail

Hi all!

I have a project that uses Sail.

The backend will be a Laravel API, the frontend will be a SPA using Vue3.

I'm trying to run all this with Sail.

The backend is working fine, Laravel / phpMyAdmin / Mailhog is running fine with Sail.

I have a problem with the frontend setup, how do I approach this?

I presume i have to ad another image/container for the vue ??

Some hints here are welcome .

0 likes
9 replies
martinbean's avatar

I presume i have to ad another image/container for the vue ??

@csaba_szekely Why? Just serve your SPA from a route in the Laravel app.

martinbean's avatar

@csaba_szekely Then yes, add a new container to serve your SPA using npm serve or whatever command you use to build and boot it.

Niush's avatar

@csaba_szekely Yes, creating separate Docker container is the way. A simple alpine environment should be enough.

csaba_szekely's avatar

@Niush Ok, can you point me to a tutorial or some documentation. I'm not searching the right terms, can't find useful links.....

azimidev's avatar

I would add another container for the frontend built with Vue.js if you want to run the frontend and backend in separate containers. I would also take a look at Inertia.js. To me its an excellent idea to use it.

Please or to participate in this conversation.