{"id":26871256,"url":"https://github.com/codeadamca/php-docker","last_synced_at":"2025-05-07T06:29:22.345Z","repository":{"id":115328410,"uuid":"470166971","full_name":"codeadamca/php-docker","owner":"codeadamca","description":"A basic example of setting up some common Docker stacks. ","archived":false,"fork":false,"pushed_at":"2025-01-31T19:37:39.000Z","size":22,"stargazers_count":19,"open_issues_count":1,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T07:18:51.345Z","etag":null,"topics":["docker","mysql","php","phpmyadmin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeadamca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-03-15T13:15:28.000Z","updated_at":"2025-03-04T17:03:51.000Z","dependencies_parsed_at":"2024-02-24T18:30:30.660Z","dependency_job_id":"41d6809a-efcd-4d69-b76c-933bee8a2443","html_url":"https://github.com/codeadamca/php-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/php-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826494,"owners_count":21810121,"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":["docker","mysql","php","phpmyadmin"],"created_at":"2025-03-31T07:18:54.720Z","updated_at":"2025-05-07T06:29:22.321Z","avatar_url":"https://github.com/codeadamca.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Docker to Setup a Basic Lamp Environment\n\nA basic example of setting up a LAMP stack from scratch using Docker. \n\nCreate a file in your project directory called `docker-compose.yml` and add the following Docker settings:\n\n```yml\nversion: '3'\nservices:\n  db:\n    image: mysql:latest\n    environment:\n      MYSQL_DATABASE: lamp_demo\n      MYSQL_USER: lamp_demo\n      MYSQL_PASSWORD: password\n      MYSQL_ALLOW_EMPTY_PASSWORD: 1\n    volumes:\n      - \"./db:/docker-entrypoint-initdb.d\"\n    networks:\n      - lamp-docker\n  www:\n    depends_on:\n      - db\n    image: php:8.1.1-apache\n    volumes:\n      - \"./:/var/www/html\"\n    ports:\n      - 80:80\n      - 443:443\n    networks:\n      - lamp-docker\n    command: \"/bin/sh -c 'docker-php-ext-install mysqli \u0026\u0026 exec apache2-foreground'\"\n  phpmyadmin:\n    depends_on:\n      - db\n    image: phpmyadmin/phpmyadmin\n    ports:\n      - 8001:80\n    environment:\n      - PMA_HOST=db\n      - PMA_PORT=3306\n    networks:\n      - lamp-docker\nnetworks:\n  lamp-docker:\n    driver: bridge\n```\n\nUsing a terminal, navigate to the same folder as your `docker-compose.yml` file and run the following command:\n\n```sh\ndocker-compose up\n```\n\nTo shut the container down push `CTRL C` and then run the folloeing command:\n\n```sh\ndocker-composer down\n```\n\n\u003e [!Note]  \n\u003e The most recent PHP/Apache Docker image does not include the `mysqli` library. This additional step needs to be completed:  \n\u003e https://github.com/docker-library/php/issues/391\n\n***\n\n## Repo Resources\n\n* [Visual Studio Code](https://code.visualstudio.com/)\n* [Docker](https://www.docker.com/)\n* [PHP](https://php.net)\n\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fphp-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fphp-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fphp-docker/lists"}