Issues with Vite
DimasPng opened this issue · 1 comments
Greetings,
I have recently integrated a Docker container setup into my Laravel project, which includes a .docker directory and a docker-compose.yml file from this repo. The containers are launched successfully using the docker-compose up -d command. However, I am encountering an issue with Vite, as it seems not to be functioning as expected.
Upon accessing the Laravel Breeze login page, I observed that the Vite assets are not loading correctly. Here's a screenshot for reference: image
I am seeking guidance on how to modify my Docker configuration to ensure that Vite files are compiled automatically upon container startup. I believe the solution may involve adding a npm run build command to the Docker configuration, but I'm unsure how to implement this correctly.
Thank you in advance for your time and assistance.
I am seeking guidance on how to modify my Docker configuration to ensure that Vite files are compiled automatically upon container startup.
Add the below code under services
on your docker-compose.yml
file.
vite-build:
image: node:latest
volumes:
- .:/var/www
working_dir: /var/www
command: bash -c "npm install && npm run build"