This project provides a professional, "WordPress-style" Docker environment for Laravel, with the application code isolated in a dedicated src/ directory.
To set up the project:
-
Clone the repository.
-
Start the containers:
docker-compose up -d --build
-
Manual Installation (Optional): If your
src/directory is empty or missing, you can manually bootstrap a clean Laravel project by running:docker-compose run --rm composer create-project laravel/laravel ./
-
Access the application:
- Web App: http://localhost
- Database Admin (phpMyAdmin): http://localhost:3000
Note
Unlike the initial setup, this version assumes the src/ directory already contains a Laravel application. If you are starting completely fresh, you would need to run docker-compose run --rm composer create-project laravel/laravel src once manually.
The project is organized to separate infrastructure from application code:
src/: Contains the entire Laravel application.docker/: Contains theDockerfilefor the PHP-Apache environment.docker-compose.yml: The main orchestration file.
You can run Artisan and Composer commands directly through Docker without needing PHP installed on your host machine.
# Run migrations
docker-compose run --rm artisan migrate
# Clear cache
docker-compose run --rm artisan cache:clear# Update dependencies
docker-compose run --rm composer updateThe project uses a MySQL 8.0 container.
- Host:
db(internal to Docker) - Internal Port:
3306 - External Port (Host):
3307 - Database Name:
laravel - Username:
laravel - Password:
password - Root Password:
root