PHP 8.2-FPM Docker image for Laravel apps with common extensions and Composer baked in.
231
A developer-friendly PHP 8.2-FPM Docker image built specifically for Laravel applications. Comes with all the essential extensions and tools you need, plus runs as a non-root user for better security.
Quick guide available here
admin user (uid: 1001) for securityservices:
# PHP-FPM Application Container
app:
image: jcadima/laravel-php:8.2
container_name: laravel-app
restart: unless-stopped
working_dir: /var/www/laravel
volumes:
- ./src:/var/www/laravel:delegated # Use delegated for better performance on macOS
environment:
- PHP_IDE_CONFIG=serverName=laravel-docker
networks:
- laravel-net
depends_on:
- db
# Nginx Web Server
nginx:
image: nginx:1.23-alpine
container_name: laravel-nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./src:/var/www/laravel:delegated
- ./docker-compose/nginx/http.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- laravel-net
depends_on:
- app
# MySQL Database
db:
image: mysql:8
container_name: laravel-db
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: "laravel"
MYSQL_USER: "laravel"
MYSQL_PASSWORD: "secret"
MYSQL_ROOT_PASSWORD: "secret"
volumes:
- db-data:/var/lib/mysql
- ./docker-compose/mysql/init:/docker-entrypoint-initdb.d # Optional: Custom init scripts
networks:
- laravel-net
command: --default-authentication-plugin=mysql_native_password
volumes:
db-data:
driver: local
networks:
laravel-net:
driver: bridge
Content type
Image
Digest
sha256:6b1d92c3a…
Size
215.3 MB
Last updated
about 1 year ago
docker pull jcadima/laravel-php:8.2