{"id":17782760,"url":"https://github.com/geerteltink/dockerfiles","last_synced_at":"2025-03-16T01:33:21.461Z","repository":{"id":43350454,"uuid":"58466400","full_name":"geerteltink/dockerfiles","owner":"geerteltink","description":"Skeleton for a Docker nginx / php / mysql / redis development stack. Everything in its own container!","archived":false,"fork":false,"pushed_at":"2024-11-25T11:53:32.000Z","size":481,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T04:47:39.750Z","etag":null,"topics":["alpine-linux","alpine-nginx","alpine-php","docker","docker-image","dockerfile"],"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/geerteltink.png","metadata":{"funding":{"custom":"https://www.paypal.me/xtreamwayz"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-05-10T14:04:34.000Z","updated_at":"2024-07-02T13:22:22.000Z","dependencies_parsed_at":"2022-09-22T20:01:56.457Z","dependency_job_id":"2f7ffdbf-21c0-4ce9-bdde-51e4a9266f78","html_url":"https://github.com/geerteltink/dockerfiles","commit_stats":null,"previous_names":["geerteltink/dockerfiles"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerteltink%2Fdockerfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerteltink%2Fdockerfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerteltink%2Fdockerfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerteltink%2Fdockerfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerteltink","download_url":"https://codeload.github.com/geerteltink/dockerfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801675,"owners_count":20350108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["alpine-linux","alpine-nginx","alpine-php","docker","docker-image","dockerfile"],"created_at":"2024-10-27T06:03:57.749Z","updated_at":"2025-03-16T01:33:21.148Z","avatar_url":"https://github.com/geerteltink.png","language":"Dockerfile","readme":"# dockerfiles\n\n![build-nginx](https://github.com/geerteltink/dockerfiles/workflows/build-nginx/badge.svg)\n![build-mysql](https://github.com/geerteltink/dockerfiles/workflows/build-mysql/badge.svg)\n![build-php-8-0](https://github.com/geerteltink/dockerfiles/workflows/build-php-8-0/badge.svg)\n![build-php-8-1](https://github.com/geerteltink/dockerfiles/workflows/build-php-8-1/badge.svg)\n![build-php-8-2](https://github.com/geerteltink/dockerfiles/workflows/build-php-8-2/badge.svg)\n\nA collection of customized containers for a Docker web development stack. Where possible the containers are build on top of [Alpine Linux](http://alpinelinux.org/) for a small footprint.\n\n## containers\n\n- **ghcr.io/geerteltink/nginx:** [latest](https://github.com/geerteltink/dockerfiles/blob/master/nginx/latest.dockerfile)\n- **ghcr.io/geerteltink/php:** [8.0-cli](https://github.com/geerteltink/dockerfiles/blob/master/php/8.0-cli.dockerfile), [8.0-fpm](https://github.com/geerteltink/dockerfiles/blob/master/php/8.0-fpm.dockerfile), [8.1-cli](https://github.com/geerteltink/dockerfiles/blob/master/php/8.1-cli.dockerfile), [8.1-fpm](https://github.com/geerteltink/dockerfiles/blob/master/php/8.1-fpm.dockerfile), [8.2-cli](https://github.com/geerteltink/dockerfiles/blob/master/php/8.2-cli.dockerfile), [8.2-fpm](https://github.com/geerteltink/dockerfiles/blob/master/php/8.2-fpm.dockerfile)\n- **ghcr.io/geerteltink/mysql:** [latest](https://github.com/geerteltink/dockerfiles/blob/master/mysql/latest.dockerfile)\n\n## Usage\n\n1. Use a custom [docker compose.yml](docker compose.yml) file to do the work for you. Adjust the settings needed for the project.\n2. Copy `.env.dist` to `.env` and change at least the project id.\n3. Start the container with `docker compose up -d`.\n\n- For consistency the source code lives in the `/app` dir.\n- The app is available at [http://localhost/](http://localhost/).\n- [MailHog](https://github.com/mailhog/MailHog) is used to catch emails and can be accessed at [http://localhost:8025/](http://localhost:8025/).\n\n## Fixing \"Permission Denied\" Issues\n\nUse setfacl to set permission on the host\n\n```bash\nsudo setfacl -Rm g:82:rwX,d:g:82:rwX /home/\u003cusername\u003e/projects\n```\n\nSetup permissions for docker so the files can be accessed and deleted.\nThe trick is to use the uid's from the docker processes.\n_www-data/nginx: 82 - docker: 999 - mysql: 28_\n\n```bash\n# Preserve default permissions for new files and folders\nsudo setfacl -dR -m u:28:rwx -m u:82:rwx -m u:33:rwx -m u:999:rwx -m u:$(whoami):rwx data\n# Set permissions\nsudo setfacl -R -m u:28:rwx -m u:82:rwx -m u:33:rwx -m u:999:rwx -m u:$(whoami):rwx data\n```\n\n## Xdebug\n\nXdebug is configured so it doesn't start automatically. You need to enable the debug listener in PhpStorm first and enable a session cookie in your [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) or [Firefox](https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc) browser.\n\n## Building manually\n\n```bash\ndocker build . --file Dockerfile --tag dev\ndocker run --rm -it tag\n```\n\n## Docker commands\n\nStart containers\n\n```bash\ndocker compose up -d\n```\n\nStart and force rebuilding the containers\n\n```bash\ndocker compose up --build\n```\n\nStop containers\n\n```bash\ndocker compose stop\n```\n\nUpdate containers\n\n```bash\ndocker compose pull\n```\n\nStream logs from all containers to the console\n\n```bash\ndocker compose logs -t -f\n```\n\nStart a terminal for \u003ccontainer_name\u003e\n\n```bash\n# With docker compose\ndocker compose run --rm php /bin/bash   # Ubuntu/Debian based\ndocker compose run --rm php /bin/sh     # Alpine Linux based\n# With docker\ndocker exec -ti \u003ccontainer_name\u003e /bin/bash   # Ubuntu/Debian based\ndocker exec -ti \u003ccontainer_name\u003e /bin/sh     # Alpine Linux based\n```\n\n## Docker maintenance commands\n\nStats for running containers\n\n```bash\ndocker stats -a\n```\n\nShow used space, similar to the unix tool df\n\n```bash\ndocker system df\n```\n\nRemove development junk: unused volumes, networks, exited containers and unused images\n\n```bash\ndocker system prune --force --all\n```\n\nList all images\n\n```bash\ndocker images\n```\n\nList containers\n\n```bash\ndocker ps\n```\n\nForce stop all containers in PowerShell\n\n```powershell\ndocker ps -a -q | ForEach { docker stop $_ }\n```\n","funding_links":["https://www.paypal.me/xtreamwayz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerteltink%2Fdockerfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerteltink%2Fdockerfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerteltink%2Fdockerfiles/lists"}