{"id":19799317,"url":"https://github.com/cicnavi/dockers","last_synced_at":"2026-03-05T21:31:32.069Z","repository":{"id":136178903,"uuid":"113046904","full_name":"cicnavi/dockers","owner":"cicnavi","description":"Docker container specifications which I use in my day to day work.","archived":false,"fork":false,"pushed_at":"2026-01-20T11:37:08.000Z","size":615,"stargazers_count":17,"open_issues_count":19,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-20T20:31:42.253Z","etag":null,"topics":["docker","php"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cicnavi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-12-04T13:35:58.000Z","updated_at":"2025-12-23T13:13:32.000Z","dependencies_parsed_at":"2024-03-17T21:52:22.537Z","dependency_job_id":"b7d5df4e-ed5d-406b-945b-99ab546b629e","html_url":"https://github.com/cicnavi/dockers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cicnavi/dockers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicnavi%2Fdockers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicnavi%2Fdockers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicnavi%2Fdockers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicnavi%2Fdockers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cicnavi","download_url":"https://codeload.github.com/cicnavi/dockers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicnavi%2Fdockers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30150407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","php"],"created_at":"2024-11-12T07:34:13.859Z","updated_at":"2026-03-05T21:31:32.021Z","avatar_url":"https://github.com/cicnavi.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# cicnavi Docker Containers\r\n\r\nThese are LAMP (Debian linux, Apache, PHP) oriented containers which I use in my day-to-day development work.\r\nMain purpose is to have development environment with different versions of PHP together with tools like\r\ncomposer, phpunit, psalm, phpcs... In addition, typical services like databases are also available.\r\n\r\n## Available containers\r\n\r\n- DAP (Debian Apache PHP) containers which follow the PHP version releases and have their names set corresponding the\r\n  PHP version, for example:\r\n    - 74.dap.test - PHP v7.4.*\r\n    - 82.dap.test - PHP v8.2.*\r\n    - ...\r\n    - 08.dap.test - Latest PHP v8.*\r\n- Database containers like MySQL, OpenLDAP, Redis...\r\n\r\n## Run containers\r\n\r\nClone the repo and enter the directory, for example:\r\n\r\n```shell\r\ngit clone https://github.com/cicnavi/dockers.git dockers\r\ncd dockers\r\n```\r\n\r\nFetch certs (or refresh them when they expire):\r\n\r\n```shell\r\n./bin/refresh-certs.sh\r\n```\r\n\r\nCopy .env.example to .env and edit .env appropriately (it holds environment variables used to run containers). \r\n\r\n```shell\r\ncp .env.example .env\r\n```\r\n\r\nYou can use 'docker compose' command to easily run defined containers in file 'compose.yml'. \r\n\r\n```shell\r\ndocker compose up -d\r\n```\r\n\r\nIf needed, create a copy of compose.yml and edit it to suit your needs. Then you can run your custom compose.yml:\r\n\r\n```shell\r\ndocker compose -f custom-compose.yml up -d\r\n```\r\n\r\n### DAP (Debian Apache PHP) Containers\r\n\r\nDAP containers are available with different PHP versions. Each folder in 'dap' folder corresponds to \r\nspecific PHP version which is used in a container. So, with this approach we can easily run different containers \r\nto test our web application on different PHP version.\r\n\r\nIf you look at the 'compose.yml' file, you'll notice that besides DAP containers, it will also run database \r\ncontainers, like MySQL, Redis... \r\n\r\n#### Configuring Apache and PHP\r\nInside 'dap' folder, there is one folder for each PHP version. For each PHP version we can set custom Apache and PHP \r\nconfiguration. You'll also find 'shared/src' folder, which can be used to share config across all containers.\r\n\r\n#### Setting source files for your web application\r\n\r\nMy approach of making source files available in containers is to mount my 'projects' folder which holds sources of\r\nall applications that I'm working on. If you look at the compose.yml file, you'll note that I'm mounting\r\n'~/projects:/var/www/projects' in all containers, so all my apps are available in /var/www/projects folder.\r\n\r\nNext, the 'html' folder should contain files which will be served publicly by the Apache web server. \r\nBy default, in 'html' folder you'll find 'index.php' file which will dump PHP information.\r\n\r\nWhen you make your application source files available for example in '/var/www/projects' folder, you can enter the\r\n'bash' in the container, and create a symlink to the application source which will be served publicly.\r\n\r\nFor example, let's enter the 'bash' in 08.dap.test container:\r\n\r\n```shell\r\ndocker exec -it 08.dap.test bash\r\n```\r\n\r\nBy default, you'll be positioned in '/var/www/html' folder. Here you can create a symlink to a source file or folder \r\nyou wish to be served by Apache:\r\n\r\n```shell\r\nln -s ../projects/some-php-app/public some-php-app\r\n```\r\n\r\nThis will create a symbolic link 'some-php-app' which will point to 'public' folder of our PHP application. Of course, \r\nyou should adjust symlinks to suit your needs.\r\n\r\nIn order to share all symlinks between containers, simply mount the default html folder in all containers like\r\nI mount './mounts/html:/var/www/html' in compose.yml.\r\n\r\n#### Running web application\r\n\r\nNote that nginx reverse proxy is used in front of all DAP containers by default.\r\n\r\nEach container has several virtual hosts appointed which can then be used to access specific container. By default,\r\neverything is configured around a wildcard domain '*.localhost.markoivancic.form.hr', which has a real certificate\r\navailable, so you can use https scheme out of the box.\r\n\r\nFor example, container 08.dap.test has a virtual host '08-dap.localhost.markoivancic.from.hr' set. That means we can\r\naccess our web application on a URL:\r\n\r\nhttps://08-dap.localhost.markoivancic.from.hr/some-php-app/.\r\n\r\nIf you only enter https://08-dap.localhost.markoivancic.from.hr, you'll get PHP info dump.\r\n\r\n#### Specifying container host names and forwarding ports\r\n\r\nYou can edit your operating system hosts file and add host names for each container.\r\nFor example, you can add the following entries:\r\n\r\n```\r\n127.0.0.1 74.dap.test\r\n...\r\n127.0.0.1 08.dap.test\r\n127.0.0.1 mysql.dap.test\r\n```\r\n\r\nThis way you can enter URL for the container like this: \r\n\r\nhttp://08.dap.test \r\n\r\n### OpenLDAP\r\n\r\nOpenLDAP containers are simply based on osixia/openldap which is available on Docker Hub. \r\nSome minor modifications for the default options were made using ENV variables:\r\n\r\n- LDAP_TLS is set to \"false\"\r\n- hostname is commented out\r\n- domainname is commented out\r\n- volume for /var/lib/ldap is set to ./ldap\r\n- volume for /etc/ldap/slapd.d is set to ./slap.d\r\n- new volume is added ./shared:/root/shared  \r\n\r\n#### Running OpenLDAP Containers\r\nOnce you've cloned this repo, go to 'openldap' directory:\r\n\r\n```shell\r\ncd dockers/openldap\r\n```\r\n\r\nHere you'll find a 'compose.yml' file. This means you can use 'docker compose' command to easily run defined \r\ncontainers (you can edit that file to suit your needs if you wish):\r\n\r\n```shell\r\ndocker compose up -d\r\n```\r\n\r\n# TODO\r\n* Consider automatic cert download for localhost.markoivancic.from.hr on nginx proxy using script and specific build","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicnavi%2Fdockers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcicnavi%2Fdockers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicnavi%2Fdockers/lists"}