{"id":23594261,"url":"https://github.com/pexmor/contained-php","last_synced_at":"2025-11-04T15:30:26.673Z","repository":{"id":209695239,"uuid":"724665575","full_name":"PexMor/contained-php","owner":"PexMor","description":"Nginx and PHP in container made simple.","archived":false,"fork":false,"pushed_at":"2023-12-01T14:02:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-27T09:16:23.961Z","etag":null,"topics":["containers","docker","example","nginx","php"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/PexMor.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}},"created_at":"2023-11-28T14:46:02.000Z","updated_at":"2023-11-28T17:12:56.000Z","dependencies_parsed_at":"2023-11-28T18:30:57.218Z","dependency_job_id":"b690159f-23f5-43eb-ab03-523065f6b8bf","html_url":"https://github.com/PexMor/contained-php","commit_stats":null,"previous_names":["pexmor/contained-php"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PexMor%2Fcontained-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PexMor%2Fcontained-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PexMor%2Fcontained-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PexMor%2Fcontained-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PexMor","download_url":"https://codeload.github.com/PexMor/contained-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239435038,"owners_count":19638047,"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":["containers","docker","example","nginx","php"],"created_at":"2024-12-27T09:16:27.690Z","updated_at":"2025-11-04T15:30:26.601Z","avatar_url":"https://github.com/PexMor.png","language":"HTML","readme":"# contained-php\n\nNginx and PHP in container made simple.\n\n\u003e Note: url `0:8080` is shorthand of `http://127.0.0.1:8080`\n\nCommand to store JSON values (note lines wrapped):\n\n```bash\ncurl -X POST \"0:8080/short/?uuid=2db9cd01-e909-448d-8883-93e2773657a7\" \\\n--data '{\"keyA\":\"valA\",\"sub\":{\"keyB\":\"valB\"}}'\n```\n\nCommand to retrieve JSON values:\n\n```bash\ncurl \"0:8080/short/?uuid=2db9cd01-e909-448d-8883-93e2773657a7\"\n```\n\ndo the same in browser like \u003chttp://127.0.0.1:8080/short/?uuid=2db9cd01-e909-448d-8883-93e2773657a7\u003e\n\nor the ultimate no `?` and `=` containing url\n\n```bash\ncurl \"0:8080/short/2db9cd01-e909-448d-8883-93e2773657a7\"\n```\n\nalternative date update:\n\n```bash\ncurl -X POST \"0:8080/short/2db9cd01-e909-448d-8883-93e2773657a7\" \\\n--data '{\"keyA\":\"valA\",\"sub\":{\"keyB\":\"valB\"}}'\n```\n\nwhich in turn is this **cute** link \u003chttp://127.0.0.1:8080/short/2db9cd01-e909-448d-8883-93e2773657a7\u003e\n\n## To test yourself\n\nThere are several option how to quickly run multiple containers that depends one on another.\nAs the primary processes that has to be containerised are `nginx` and `php-fpm` we need two containers.\nOf course the ultimate solution would be to use Kubernetes (K8s) either small like `k3`, `minicube` or\nthose that are part of `Docker Desktop` or hosted like `GKE` or `OpenShift` (self hosted as `OKD`).\n\n### Simple plain docker\n\nThe bare bones setup that uses the trick of `--network container:...` so you can just run (with docker installed):\n\n```bash\n# to download image and start nginx frontend server\n./10_run_nginx.sh\n# to download image start php-fpm backend server (used by nginx)\n./20_run_php.sh\n```\n\n### With help of docker-compose\n\nThe no-so-loved `docker-compose` Python wrapper for Docker engine can simplify some infra setup.\n\n```bash\ndocker-compose up\n```\n\nImages used:\n\n- `bitnami/nginx` - bitnami built `nginx`\n- `bitnami/php-fpm` - and accompanying `php`\n\nThe go to \u003chttp://localhost:8080\u003e beware that the port `8080` has to be available in order to start.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpexmor%2Fcontained-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpexmor%2Fcontained-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpexmor%2Fcontained-php/lists"}