y9938 e13724a8be build(docker): optimize image size and security
- add mysql client binaries for database operations
- reduce php extensions to production essentials
- bind mysql and phpmyadmin to localhost only
- replace php-fpm.conf with php.ini for upload limits
2026-03-21 04:22:39 +03:00
2025-10-06 03:09:52 +03:00

Laravel Docker Setup

  • PHP-FPM, NGINX, MySQL, phpMyAdmin (in compose.yaml)

Run a container

cp .env.example .env
# !change .env for yourself
docker compose up -d php-fpm
docker compose exec --user www php-fpm bash
# or `just shell`

Create a project:

Rewrite below for yourself:

RECOMENDED:

The latest version via laravel/installer package

composer global require laravel/installer && \
export PATH="$HOME/.composer/vendor/bin:$PATH"

# Check options via `laravel new -h`
laravel new example-app

# copy your `.env` content to `example-app/.env`
mv example-app/* example-app/.* ./
rmdir example-app

OR:

The specific version via composer

composer create-project --prefer-dist laravel/laravel example-app ^11.0

# copy your `.env` content to `example-app/.env`
mv example-app/* example-app/.* ./
rmdir example-app

Quick Actions

just
Description
No description provided
Readme MIT 66 KiB
Languages
Shell 46.6%
Dockerfile 29.9%
Just 23.5%