Skip to content

MechaMic38/Laravel_MySQL_Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel 11 + MySQL + Docker

Template for using Laravel + MySQL in a Docker environment.

How To Use

First of all, you need to make a copy of the file .env.example in the project root folder, and rename it as .env. This also need to be done with the .env.example file within the src folder.

Remember to set all appropriate environment variables, if needed.

First launch

For the first launch of the program, you must execute the following command. This creates all the containers necessary to run the application.

docker compose build

After that completes, run the following to install and compile the dependencies for the application:

docker compose run --rm composer install
docker compose run --rm npm install
docker compose run --rm npm run build

Finally, launch all application containers, and run the necessary migrations:

docker compose up
docker compose run --rm artisan migrate

Subsequent Launches

For all subsequent launches, you just need to execute:

docker compose up

When you are finished, you can close the application (and destroy all containers) by using:

docker compose down

You can access the application through http://localhost:8000/.

About

Template for using Laravel + MySQL in a Docker environment.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published