GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pluswerk/php-dev: Docker Image for PHP-Web Development

BranchesTags
Open more actions menu

Latest commit

 

History

308 Commits
308 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
docs
docs
 
 
entrypoint.d
entrypoint.d
 
 
.additional_bashrc.sh
.additional_bashrc.sh
 
 
.additional_bashrc_ps1.sh
.additional_bashrc_ps1.sh
 
 
.gitignore
.gitignore
 
 
.my.cnf
.my.cnf
 
 
.vimrc
.vimrc
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
apache.conf
apache.conf
 
 
localBuild.sh
localBuild.sh
 
 
profiler.php
profiler.php
 
 
start.sh
start.sh
 
 

Repository files navigation

php-dev

PHP-DEV is a small package that includes a web server, PHP and some tools needed to develop a web application. You can easily decide which version of PHP you want to use and whether you want to start an Apache or a Nginx webserver by setting the values in a docker-compose.yml. We recommend using pluswerk/docker-global as a wrapper for your projects, since this Dockerfile has been built keeping that in mind.

Tags

  • php versions supported: 8.1-8.5
  • php versions unsupported: 5.6-8.0
  • webserver supported: nginx and apache
  • alpine images: -alpine
  • examples
    • pluswerk/php-dev:nginx-8.5-alpine
    • pluswerk/php-dev:apache-8.1-alpine
    • pluswerk/php-dev:nginx-8.4
  • list of all Tags

Setup

Create a compose/Development/docker-compose.yml like shown below.
Change all your settings. Mainly the VIRTUAL_HOST, WEB_DOCUMENT_ROOT and optionally the Application Context. The Environment Variable CONTEXT is used to switch between different docker-compose.yml files.

Then you can copy the start.sh into your project and start it.

Documentation

The base Docker Images are webdevops/php-apache-dev and webdevops/php-nginx-dev respectively. (github)

Features

  • XDebug - how to debug your code
  • Environment Variables - what can I configure
  • PHP Profiling - why is my code so slow/memory hungry

Helpful Information

  • Code Coverage - I want to test my code with code coverage (phpunit, infection)
  • Change docker project name - all my projects are in folders named the same
  • Nginx Reverse Proxy - VIRTUAL_HOST explanation
  • TYPO3 configuration >=8 - AdditionalConfiguration.php
  • TYPO3 configuration <=7 - AdditionalConfiguration.php
  • ImageMagick or GraphicMagick - using php module

Docker compose

This is an example of a docker-compose.yml file. It is enough to put this file into the project, configure it and start the Docker Project. Further information can be found in the Documentation.

Example file: compose/Development/docker-compose.yml

services:
  web:
    image: pluswerk/php-dev:nginx-8.5-alpine

    volumes:
      - .:/app
# the docker socket is optional if no node container is needed
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ~/.ssh:/home/application/.ssh
      - ~/.composer/cache:/home/application/.composer/cache
      - ~/.gitconfig:/home/application/.gitconfig

    environment:
#     Take a look at VIRTUAL_* in the documentation under Nginx Reverse Proxy
      VIRTUAL_HOST: docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required},sub.docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required}
#     HTTPS_METHOD: noredirect

      WEB_DOCUMENT_ROOT: /app/public
      XDEBUG_CLIENT_HOST: ${XDEBUG_CLIENT_HOST:-}
      php.xdebug.idekey: ${XDEBUG_IDEKEY:-PHPSTORM}
      PHP_IDE_CONFIG: ${XDEBUG_IDEKEY:-"serverName=_"}

#      Project Env vars (enable what you need)
#      APP_ENV: development_docker
#      PIMCORE_ENVIRONMENT: development_docker
#      TYPO3_CONTEXT: Development/docker

#      Don't forget to connect via bash start.sh
      APPLICATION_UID: ${APPLICATION_UID:-1000}
      APPLICATION_GID: ${APPLICATION_GID:-1000}

  node:
    image: node:24
    volumes:
      - ./:/app
    working_dir: /app
    environment:
#      Don't forget to connect via bash start.sh
      APPLICATION_UID: ${APPLICATION_UID:-1000}
      APPLICATION_GID: ${APPLICATION_GID:-1000}
    stop_signal: SIGKILL
    entrypoint: bash -c 'groupmod -g $$APPLICATION_GID node; usermod -u $$APPLICATION_UID node; sleep infinity'

networks:
  default:
    name: global
    external: true

Hint for the example above: In your own configuration you might want to replace docker-website with your project name, e.g typo3. TLD_DOMAIN is an environment variable, your nginx container listens on for incoming requests. e.g. example.com. Your project will then be reachable by going to this domain: typo3.example.com

Tested with

This project is a basic php-installation and should be able to run most applications. Nonetheless has this tool successfully been tested/used with:

  • TYPO3 >=7
  • PIMCore >= 5.4
  • Standalone PHP (Symfony, Laravel/Lumen, Vanilla) Projects
  • WordPress >= 4.5

If you find any bug, don't hesitate to file an issue and/or pull request.

About

Docker Image for PHP-Web Development

github.com/pluswerk/php-dev/pkgs/container/php-dev

Topics

containerdevelopmentdockerhacktoberfestphp-devwebdevops

Resources

Readme
Activity
Custom properties

Stars

10 stars

Watchers

4 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.