This repository provides a custom PHP 8.4 Docker image based on the Bullseye distribution, optimized for running Laravel applications. It includes pre-installed PHP extensions, tools, and multi-architecture support for AMD64 and ARM64. 🚀
This Dockerfile is tailored for Laravel applications and includes the following features:
- PHP 8.4 with FPM (FastCGI Process Manager).
- ✅ Pre-installed PHP Extensions:
- Essential extensions required by most Laravel applications.
- See the Extension Table below for a full list. 🧩
- ✅ Pre-installed Tools:
- Composer (globally available for dependency management).
- MongoDB Tools (e.g.,
mongodump
) for database backups and operations.
- ✅ Xdebug:
- Included but disabled by default for production readiness.
- XDebug 3.4.0beta1 is used for compatibility with php 8.4
- ✅ Multi-Architecture Builds:
- Supports both AMD64 (x86_64) and ARM64 (aarch64) architectures.
Here’s a detailed list of pre-installed PHP extensions:
Extension | Description | Status |
---|---|---|
pdo_mysql | MySQL database support | ✅ |
pdo_pgsql | PostgreSQL database support | ✅ |
pdo_sqlite | SQLite lightweight database support | ✅ |
mbstring | Multibyte string handling for UTF-8 support | ✅ |
intl | Internationalization and localization features | ✅ |
gd | Image processing (JPEG, PNG) | ✅ |
zip | Support for ZIP compression | ✅ |
opcache | Performance optimization through script caching | ✅ |
soap | SOAP-based web services | ✅ |
redis | Redis for caching and sessions | ✅ |
memcached | Memcached for caching and sessions | ✅ |
mongodb | MongoDB database support | ✅ |
gmp | Arbitrary precision arithmetic | ✅ |
exif | Metadata handling for images | ✅ |
-
Composer:
- Installed globally for dependency management.
- Optimized to use only HTTPS for Packagist repositories.
-
MongoDB Tools:
- Includes mongodump for backup operations and other utilities.
This Docker image is available on Docker Hub. You can pull it directly or use it as a base image in your own Dockerfile:
FROM atyantik/laravel-php:8.4-bullseye
- Build your Laravel application image using this base image:
FROM atyantik/laravel-php:8.4-bullseye COPY . /var/www/html WORKDIR /var/www/html RUN composer install --no-dev --optimize-autoloader
- Start the container:
docker run -p 8000:9000 my-laravel-app
Follow these steps to build the image yourself:
-
Clone the Repository:
git clone https://github.com/atyantik/laravel-php-docker.git cd laravel-php-docker
-
Enable Buildx for Multi-Architecture Builds:
- If Buildx is not set up, enable it by following Docker's Buildx Guide.
-
Build AMD64 Image:
docker buildx build --platform="linux/amd64" -t atyantik/laravel-php:8.4-bullseye-amd64 .
-
Build ARM64 Image:
docker buildx build --platform="linux/arm64" -t atyantik/laravel-php:8.4-bullseye-arm64 .
-
Push Images to Docker Hub:
docker push atyantik/laravel-php:8.4-bullseye-amd64 docker push atyantik/laravel-php:8.4-bullseye-arm64
-
Create and Push a Manifest for Multi-Architecture:
docker manifest create atyantik/laravel-php:8.4-bullseye \ atyantik/laravel-php:8.4-bullseye-amd64 \ atyantik/laravel-php:8.4-bullseye-arm64 docker manifest push atyantik/laravel-php:8.4-bullseye
- Docker Hub Repository: https://hub.docker.com/repository/docker/atyantik/laravel-php
- Atyantik Technologies: atyantik.com
At Atyantik Technologies, we specialize in building world-class software solutions with a focus on innovation, scalability, and efficiency. We believe in delivering value through cutting-edge technologies and industry best practices.
💻 Visit us at: atyantik.com