Skip to content

Atyantik/docker-laravel-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

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