To set up a new Laravel project with Docker, you can use the following script. This will create a new Laravel project, set up Docker with a Dockerfile and docker-compose.yaml, and configure the .env file with MySQL settings.
Make sure you have composer, docker, and docker-compose installed on your system.
You can set up your Laravel project quickly by running this command:
curl -sSL https://gist.github.com/devinci-it/eaf93ed4982ee6dc4055245cd3d8ff00/raw/setup.sh | bash -sFollow the prompts to enter your Laravel application name when prompted.
Once the setup completes, you can access your Laravel application at http://localhost:8000.
-
SSH into the app container:
docker-compose exec app bash -
MySQL Database:
- Database Name: Your application name
- Username:
${APP_NAME}user - Password:
${APP_NAME}password
- Make sure to review and customize the Dockerfile and docker-compose.yaml files as per your project's requirements.
- Ensure your system meets the prerequisites before running the script.
If you encounter any issues during the setup, make sure Docker and its dependencies are properly installed and configured on your system. If you need further assistance, refer to the Docker documentation or Laravel documentation.