Skip to content

Atyantik/docker-laravel-php

Repository files navigation

Atyantik's Laravel PHP Docker Image 🌟

Docker Hub

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. πŸš€


✨ Features: What This Dockerfile Provides

This Dockerfile is tailored for Laravel applications and includes the following features:

  1. PHP 8.4 with FPM (FastCGI Process Manager).
  2. βœ… Pre-installed PHP Extensions:
    • Essential extensions required by most Laravel applications.
    • See the Extension Table below for a full list. 🧩
  3. βœ… Pre-installed Tools:
    • Composer (globally available for dependency management).
    • MongoDB Tools (e.g., mongodump) for database backups and operations.
  4. βœ… Xdebug:
    • Included but disabled by default for production readiness.
    • XDebug 3.4.0beta1 is used for compatibility with php 8.4
  5. βœ… Multi-Architecture Builds:
    • Supports both AMD64 (x86_64) and ARM64 (aarch64) architectures.

🧩 PHP Extensions

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 βœ…

πŸ›  Pre-installed Tools

  1. Composer:

    • Installed globally for dependency management.
    • Optimized to use only HTTPS for Packagist repositories.
  2. MongoDB Tools:

    • Includes mongodump for backup operations and other utilities.

πŸš€ How to Use

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

Example: Running a Laravel Application

  1. 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
  2. Start the container:
    docker run -p 8000:9000 my-laravel-app

πŸ›  Compilation Steps

Follow these steps to build the image yourself:

  1. Clone the Repository:

    git clone https://github.com/atyantik/laravel-php-docker.git
    cd laravel-php-docker
  2. Enable Buildx for Multi-Architecture Builds:

  3. Build AMD64 Image:

    docker buildx build --platform="linux/amd64" -t atyantik/laravel-php:8.4-bullseye-amd64 .
  4. Build ARM64 Image:

    docker buildx build --platform="linux/arm64" -t atyantik/laravel-php:8.4-bullseye-arm64 .
  5. Push Images to Docker Hub:

    docker push atyantik/laravel-php:8.4-bullseye-amd64
    docker push atyantik/laravel-php:8.4-bullseye-arm64
  6. 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

🌐 Links


🀝 About Atyantik Technologies

Atyantik Logo

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

About

PHP Container for maintaining Laravel applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published