This repo is a docker boilerplate to use for Laravel projects. Containers included in this docker:
- Laravel 11
- FrankenPHP
- MySQL
- Redis
- Supervisor
- Octane
- Minio for S3
- MailPit
The purpose of this repo is to run Laravel 11 in a Docker container using Octane and FrankenPHP.
Use the package manager git to install Docker boilerplate.
# setup project locally
$ git clone https://github.com/jaygaha/laravel-11-frankenphp-docker.git
# Navigate to project directory:
$ cd laravel-11-frankenphp-docker
Copy the .env.example file to .env:
# Linux
$ cp .env.example .env
# OR
# Windows
$ copy .env.example .env
Edit the .env
file to configure your application settings. At a minimum, you should set the following variables:
APP_NAME
: The name of your application.APP_ENV
: The environment your application is running in (e.g., local, production).APP_KEY
: The application key (will be generated in the next step).APP_DEBUG
: Set totrue
for debugging.APP_URL
: The URL of your application.DB_CONNECTION
: The database connection (e.g., mysql).DB_HOST
: The database host.DB_PORT
: The database port.DB_DATABASE
: The database name.DB_USERNAME
: The database username.DB_PASSWORD
: The database password.
Edit docker related setting according to your preferences.
Run composer to install the required packages:
# install required packages
$ composer install
Generate a new application key:
# app key setup
$ php artisan key:generate
Build the Docker images:
# build docker images
$ docker compose build
Run the containers:
# Run containers
$ docker compose up -d
To stop the containers, run:
# Stop containers
$ docker compose down
To view the logs of a specific container, run:
# View logs
$ docker compose logs <container_name>
If you are using podman replace docker
with podman
To access the application, open your browser and navigate to the URL specified in the APP_URL
variable in your .env
file.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FREE TO USE