Skip to content

Simple docker image for PHP development

License

Notifications You must be signed in to change notification settings

dinhquochan/docker-php

 
 

Repository files navigation

Docker PHP-FPM & Nginx base on Alpine Linux

Simple docker image for PHP/Laravel development. This is a folk from pnlinh/docker-php.

Why should use this image

  • Built on the lightweight and secure Alpine Linux distribution
  • Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64
  • Use runit instead of supervisor
  • Very small Docker image size

PHP version support

  • PHP 8.0
  • PHP 8.1 (recommend usage)
  • PHP 8.2 (recommend usage)
  • PHP 8.3

How to use

  • Build image
VERSION=8.0 make build # Build image with php 8.0
VERSION=8.1 make build # Build image with php 8.1
VERSION=8.2 make build # Build image with php 8.2
VERSION=8.3 make build # Build image with php 8.3
  • How to customize image name
VERSION=8.0 IMAGE=archielite/laravel:php make build # Build image with php 8.0
VERSION=8.1 IMAGE=archielite/laravel:php make build # Build image with php 8.1
VERSION=8.2 IMAGE=archielite/laravel:php make build # Build image with php 8.2
VERSION=8.3 IMAGE=archielite/laravel:php make build # Build image with php 8.3
  • Test image by PHP version
VERSION=8.3 make test
VERSION=8.2 make test
VERSION=8.1 make test
VERSION=8.0 make test
  • Test all image
make test-all
  • Mount your code to be served with container
docker run --name=app -v /path/to/project:/var/www/html -p 80:80 dinhquochan/laravel:php8.1
  • Using docker-compose
version: '3.4'

services:
    app:
        image: dinhquochan/laravel:php8.1
        hostname: laravel-app
        container_name: laravel-app
        ports:
            - "80:80"
        volumes:
            - .:/var/www/html
        networks:
            - localnet
networks:
    localnet:
        driver: "bridge"

image

Add Xdebug

References

Security

If you discover any security related issues, please email contact@dinhquochan.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Simple docker image for PHP development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 59.8%
  • Shell 31.0%
  • Makefile 9.2%