Running Laravel and React stacks together using Vite and InertiaJS on Docker.
Explore project's blog »
Report Bug
·
Request Feature
Table of Contents
This is a Laravel boilerplate running with ReactJS as frontend on Docker. It makes use of Vite and InertiaJS to achieve this.
For more details, please refer to the project's Blog
Here is a list of major frameworks used to bootstrap the project.
To get a local copy up and running follow these simple steps.
In order to run this prroject you should have Docker
and Docker Compose
installed on your local machine.
To set up the application simply clone the repo using the below command.
git clone https://github.com/elvinlari/laravel-vite-docker.git
You can use this code as a boilerplate for building your next Cloud Native Laravel application.
Containers from this project can be deployed on Kubernetes, Docker Swarm or whichever orchestrator you prefer.
- Project core
- Add git actions for creating and uploading docker images to a Registry
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
file for more information.
Elvin Lari - @elvinlarie - elvinlari@gmail.com
Project Link: https://github.com/elvinlari/laravel-vite-docker
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!
- Choose an Open Source License
- Vite JS
- Inertia JS
- Malven's Grid Cheatsheet
- Img Shields
- GitHub Pages
- Font Awesome
- React Icons
Estos comandos te ayudarán a configurar y ejecutar tu aplicación Laravel utilizando Docker y Composer.
docker system prune -a # [OPT] Limpia todos los contenedores, imágenes, redes y volúmenes no utilizados.
docker-compose up --build nginx -d # Construye y levanta el contenedor nginx en segundo plano.
docker-compose run --rm composer clear-cache # [OPT] Limpia la caché de Composer.
docker-compose run --rm composer install # Instala las dependencias definidas en composer.json.
docker-compose run --rm composer dump-autoload # [OPT] Re-genera el archivo autoload de Composer.
docker-compose run --rm composer require laravel/breeze --dev # [OPT] Añade laravel/breeze como dependencia de desarrollo.
docker-compose run --rm composer require inertiajs/inertia-laravel # [OPT VITE] Añade Inertia.js para Laravel.
docker-compose run --rm composer require tightenco/ziggy # [OPT] Añade Tightenco/Ziggy para manejo de rutas.
docker-compose run --rm composer require sebastian/version # [OPT] Añade sebastian/version.
docker-compose run --rm composer update # [OPT] Actualiza todas las dependencias de Composer.
docker-compose run --rm laravel-migrate-seed # Ejecuta migraciones y seeds.
docker-compose run --rm artisan migrate:status # [OPT] Verifica el estado de las migraciones.
docker-compose run --rm artisan key:generate # [OPT] Genera una nueva clave de aplicación.
docker-compose run --rm artisan optimize # [OPT] Optimiza el cargador automático.
docker-compose run --rm artisan config:cache # [OPT] Cachea el archivo de configuración.
docker-compose run --rm artisan optimize # [OPT] Optimiza la configuración de la aplicación.
docker-compose run --rm artisan serve # [OPT] Inicia el servidor de desarrollo de Laravel.
docker-compose run --rm artisan route:list # [OPT] Lista todas las rutas definidas en la aplicación.
docker-compose run --rm artisan inertia:middleware # [OPT] Configura el middleware de Inertia.js.
docker-compose run --rm npm install # Instala las dependencias definidas en package.json.
docker-compose run --rm npm install @myorg/privatepackage # [ERROR] Instala un paquete privado específico.
docker-compose run --rm npm run build # Construye la aplicación para producción.
docker-compose run --rm npm i react react-dom @inertiajs/inertia @inertiajs/inertia-react jsconfig.json @inertiajs/progress # [OPT] Añade React y otros paquetes necesarios.
docker-compose run --rm npm add @vitejs/plugin-react # [OPT] Añade el plugin React para Vite.
docker-compose run --rm --service-ports npm run dev # [ERROR] Inicia el servidor de desarrollo utilizando Vite.
#admin@gmail.com:password