Skip to content

Docker image for PHP developing in an Debian environment. Created originally by Ulf Seltmann at https://github.com/smoebody/docker-dev-dotdeb and used for developing Typo3 website at Leipzig University Library.

License

Notifications You must be signed in to change notification settings

ubleipzig/dev-dotdeb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-dev-dotdeb

What is this image intended for?

This image goes to all the php developers that want a developmnent testing environment set up in no time.

It is out of the box usable on linux hosts with a docker version >= 1.3

The image prepares apache2, php and mysql and wraps around your local codebase.

the following tools next to apache2, php 5.x (depending on the label) and mysql are at your service:

  • xdebug
  • webgrind
  • phpinfo

How to use this image

now you can use the docker to use this folder as vufind base and wrap the runtime environment around

docker run --name dev-dotdeb -d -v /path/to/my/project:/app -p 127.0.0.1:80:80 useltmann/dev-dotdeb

this starts the container named dev-dotdeb and sets up all the components with its default values. you should now be able to reach the your project folder at

http://127.0.0.1/

How to debug

By default php is configured up to start a debugging session indicated by request parameters. this comes in handy to use with several browser-addons (e.g. xdebug-helper for chrome). Therefore the IDE should be configured to accept remotely started debugging sessions.

How to to profile

Also xdebug is able to profile script runs. The trace protocols can be used to determine potential performance issues. A tool that analyses that protocols is webgrind which is integrated in the docker image and reachable here

http://127.0.0.1/webgrind

PHPINFO

look at the PHP-configuration at http://127.0.0.1/phpinfo

XCache (only in php54 and php55)

look at the XCache statistics at http://127.0.0.1/xcache

how to test mail send

This utilises the docker-image useltmann/mailcollect which acts as smtp-server and catches all sent emails in one inbox, regardless where its sent.

to use it in conjunction with this docker-image you should start a container first. after its up and running you have to link this container to the dev-dotdeb container by adding the --link option to the run-command above

docker run --name dev-dotdeb -d -v /path/to/my/project:/app -p 127.0.0.1:80:80 --link=mailcollect:smtp -e SMTP_HOST=smtp docker.io/useltmann/dev-dotdeb

The dev-dotdeb container is now connected to the mailcollect container and all mail that is sent by it ends in the mailcollects inbox. see useltmann/mailcollect for further details.

run a interactive console in the container

docker exec -ti dev-dotdeb /bin/bash

Advanced configuration

the following environment variables can be set when creating (run) a new container. the values given here are the default values.

  • APP_HOME=/app
    defines the application folder, normally where your application resides. there are some rare cases where strange software needs to be configured to reside in a special place
  • APP_USER=dev
    defines the user php is running with
  • FCGID_MAX_REQUEST_LEN=16384000
    defines the maximum request length that the webserver (apache2) is passing to the fcgi daemon (php)
  • TIME_ZONE=Europe/Berlin defines the timezone php is working in
  • SHIB_HOSTNAME=https://localhost
    defines the hostname, port and scheme that is used to create the metadata for SP-registration (schema and port are taken from the request, not from this configuration!)
  • SHIB_HANDLER_URL=/Shibboleth.sso
    defines the shibboleth handler location
  • SHIB_SP_ENTITY_ID=https://hub.docker.com/r/useltmann/dev-dotdeb
    defines the sp's entity id. be aware that you have to specify a different entityId in order to enable shibboleth support. if you leave the default entityId, shibboleth will not start
  • SHIB_IDP_DISCOVERY_URL=https://wayf.aai.dfn.de/DFN-AAI-Test/wayf
    defines the discovery url. you can also define a distinct IDP by providing the variable SHIB_IDP_ENTITY_ID instead
  • SHIB_STATUS_ACL
    defines the ip from where shibboleth status requests are allowed. normally this is your public ip
  • SHIB_ATTRIBUTE_MAP
    defines simple attribute mappings in style name=id and seperate multiple definitions with comma, i.e. if you want to define a new Attribute with name "urn:oid:1.3.6.1.4.1.5923.1.1.1.9" and id "affiliation" you should do as follows' `SHIB_ATTRIBUTE_MAP="urn:oid:1.3.6.1.4.1.5923.1.1.1.9=affiliation"
  • SQL_MODE
    defines the sql_mode that mysqld is running with. I.e. SQL_MODE="STRICT_TRANS_TABLES"
  • SMTP_HOST
    defines the smtp host that takes mails sent by php. if none is provided the php default values take place
  • SMTP_NAME=dev-dotdeb
    defines the host name as which the container sents his emails
  • SMTP_PORT=25
    defines the port on which the container trys to connect to the smtp host

for now only DFN-Test-IDP Metadata is supported.

To do

  • outsource database utilisation

About

Docker image for PHP developing in an Debian environment. Created originally by Ulf Seltmann at https://github.com/smoebody/docker-dev-dotdeb and used for developing Typo3 website at Leipzig University Library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published