Convert Figma logo to code with AI

serversideup logodocker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!

1,671
109
1,671
20

Top Related Projects

12,358

Full PHP development environment for Docker.

Quick Overview

The serversideup/docker-php repository is a collection of Docker images for PHP development and production environments. It provides pre-configured, optimized PHP images with various extensions and tools, designed to streamline the setup process for PHP applications in Docker containers.

Pros

  • Ready-to-use PHP images with common extensions and tools pre-installed
  • Optimized for both development and production environments
  • Regular updates to keep up with the latest PHP versions and security patches
  • Supports multiple PHP versions (7.4, 8.0, 8.1, 8.2)

Cons

  • Limited customization options for specific use cases
  • May include unnecessary extensions for some projects, potentially increasing image size
  • Requires familiarity with Docker and containerization concepts

Getting Started

To use these Docker images in your project, follow these steps:

  1. Choose the appropriate PHP version and variant (e.g., serversideup/php:8.2-fpm-nginx)
  2. Create a Dockerfile in your project root:
FROM serversideup/php:8.2-fpm-nginx

# Copy your application files
COPY . /var/www/html

# Install additional dependencies if needed
RUN apt-get update && apt-get install -y \
    your-package-here \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Set up any custom configurations
COPY custom-php.ini /usr/local/etc/php/conf.d/custom-php.ini
  1. Build and run your Docker container:
docker build -t my-php-app .
docker run -p 8080:80 my-php-app

Your PHP application should now be accessible at http://localhost:8080.

Competitor Comparisons

12,358

Full PHP development environment for Docker.

Pros of Laradock

  • More comprehensive ecosystem with a wider range of services and tools
  • Highly customizable with extensive configuration options
  • Large and active community, providing better support and frequent updates

Cons of Laradock

  • Steeper learning curve due to its complexity and extensive options
  • Potentially resource-intensive, especially for smaller projects
  • May include unnecessary services for simpler applications

Code Comparison

Laradock (docker-compose.yml):

version: '3'
services:
  php-fpm:
    build:
      context: ./php-fpm
      args:
        - LARADOCK_PHP_VERSION=${PHP_VERSION}
    volumes:
      - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}

Docker-PHP (docker-compose.yml):

version: '3.8'
services:
  php:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/var/www/html

Laradock offers more granular control over PHP versions and configuration, while Docker-PHP provides a simpler setup with fewer customization options. Laradock's approach is better suited for complex projects with diverse requirements, whereas Docker-PHP is more straightforward for smaller applications or those new to Docker.

Both repositories aim to simplify PHP development environments using Docker, but they cater to different levels of complexity and user experience. The choice between them depends on the project's specific needs and the developer's familiarity with Docker and containerization concepts.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Docker Images Logo

Build Status License Support us
Docker Hub Pulls Discord

Introduction

serversideup/php is an optimized set of Docker Images for running PHP applications in production. Everything is designed around improving the developer experience with PHP and Docker. Gone are the days of configuring each environment differently, and gone are the days of trying to figure out why your code works in one environment and not the other.

These images are highly optimized to run modern PHP applications, no matter where you want your application to run.

Experience the true difference of using these images vs the other options out there.

Read more about the key differences with these images →

Features
Production-ReadyNative Health ChecksHigh Performance
Customizable and FlexibleNative CloudFlare SupportBase on Official PHP
NGINX UnitUnified LoggingFPM + S6 Overlay

Usage

This repository creates a number of Docker image variations, allowing you to choose exactly what you need.

Simply use this image name pattern in any of your projects:

serversideup/php:{{version}}-{{variation-name}}

For example... If I wanted to run PHP 8.2 with FPM + NGINX, I would use this image:

serversideup/php:8.2-fpm-nginx

[!NOTE]
All our images are available on Docker Hub and GitHub Packages. 🥳

⚙️ Variation🚀 Version
cliDebian Based
serversideup/php:8.3-cli
serversideup/php:8.2-cli
serversideup/php:8.1-cli
serversideup/php:8.0-cli
serversideup/php:7.4-cli
Alpine Based
serversideup/php:8.3-cli-alpine
serversideup/php:8.2-cli-alpine
serversideup/php:8.1-cli-alpine
serversideup/php:8.0-cli-alpine
serversideup/php:7.4-cli-alpine
fpmDebian Based
serversideup/php:8.3-fpm
serversideup/php:8.2-fpm
serversideup/php:8.1-fpm
serversideup/php:8.0-fpm
serversideup/php:7.4-fpm
Alpine Based
serversideup/php:8.3-fpm-alpine
serversideup/php:8.2-fpm-alpine
serversideup/php:8.1-fpm-alpine
serversideup/php:8.0-fpm-alpine
serversideup/php:7.4-fpm-alpine
fpm-apacheDebian Based
serversideup/php:8.3-fpm-apache
serversideup/php:8.2-fpm-apache
serversideup/php:8.1-fpm-apache
serversideup/php:8.0-fpm-apache
serversideup/php:7.4-fpm-apache
fpm-nginxDebian Based
serversideup/php:8.3-fpm-nginx
serversideup/php:8.2-fpm-nginx
serversideup/php:8.1-fpm-nginx
serversideup/php:8.0-fpm-nginx
serversideup/php:7.4-fpm-nginx
Alpine Based
serversideup/php:8.3-fpm-nginx-alpine
serversideup/php:8.2-fpm-nginx-alpine
serversideup/php:8.1-fpm-nginx-alpine
serversideup/php:8.0-fpm-nginx-alpine
serversideup/php:7.4-fpm-nginx-alpine
unitDebian Based
serversideup/php:8.3-unit
serversideup/php:8.2-unit
serversideup/php:8.1-unit
serversideup/php:8.0-unit
serversideup/php:7.4-unit

Resources

  • Website overview of the product.
  • Docs for a deep-dive on how to use the product.
  • Discord for friendly support from the community and the team.
  • GitHub for source code, bug reports, and project management.
  • Get Professional Help - Get video + screen-sharing help directly from the core contributors.

Contributing

As an open-source project, we strive for transparency and collaboration in our development process. We greatly appreciate any contributions members of our community can provide. Whether you're fixing bugs, proposing features, improving documentation, or spreading awareness - your involvement strengthens the project. Please review our contribution guidelines and code of conduct to understand how we work together respectfully.

Need help getting started? Join our Discord community and we'll help you out!

Our Sponsors

All of our software is free an open to the world. None of this can be brought to you without the financial backing of our sponsors.

Sponsors

Bronze Sponsors

No bronze sponsors yet. Become a sponsor →

Individual Supporters

GeekDougle  JQuilty  

Special thanks

We'd like to specifically thank a few folks for taking the time for being a sound board that deeply influenced the direction of this project.

Please check out all of their work:

About Us

We're Dan and Jay - a two person team with a passion for open source products. We created Server Side Up to help share what we learn.

Dan Pastori
Jay Rogers


Find us at:

  • 📖 Blog - Get the latest guides and free courses on all things web/mobile development.
  • 🙋 Community - Get friendly help from our community members.
  • 🤵‍♂️ Get Professional Help - Get video + screen-sharing support from the core contributors.
  • 💻 GitHub - Check out our other open source projects.
  • 📫 Newsletter - Skip the algorithms and get quality content right to your inbox.
  • 🐥 Twitter - You can also follow Dan and Jay.
  • ❤️ Sponsor Us - Please consider sponsoring us so we can create more helpful resources.

Our products

If you appreciate this project, be sure to check out our other projects.

📚 Books

🛠️ Software-as-a-Service

  • Bugflow: Get visual bug reports directly in GitHub, GitLab, and more.
  • SelfHost Pro: Connect Stripe or Lemonsqueezy to a private docker registry for self-hosted apps.

🌍 Open Source

  • AmplitudeJS: Open-source HTML5 & JavaScript Web Audio Library.
  • Spin: Laravel Sail alternative for running Docker from development → production.
  • Financial Freedom: Open source alternative to Mint, YNAB, & Monarch Money.