| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
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.
The base Docker Images are webdevops/php-apache-dev and webdevops/php-nginx-dev respectively. (github)
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: trueHint 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
This project is a basic php-installation and should be able to run most applications. Nonetheless has this tool successfully been tested/used with:
If you find any bug, don't hesitate to file an issue and/or pull request.
| Back | FazBrowse Home | New Git URL |