{"id":19855151,"url":"https://github.com/leggedrobotics/webapp-container","last_synced_at":"2026-05-09T02:09:16.503Z","repository":{"id":83356558,"uuid":"330712842","full_name":"leggedrobotics/webapp-container","owner":"leggedrobotics","description":"Scripts and tools to containerize a PHP-FPM, Nginx, Redis web-application ⚙️","archived":false,"fork":false,"pushed_at":"2021-09-29T08:15:14.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-21T13:46:53.443Z","etag":null,"topics":["containers","docker","laravel","php","web"],"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/leggedrobotics.png","metadata":{"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-18T15:43:10.000Z","updated_at":"2021-09-29T08:15:17.000Z","dependencies_parsed_at":"2023-03-12T18:07:43.768Z","dependency_job_id":null,"html_url":"https://github.com/leggedrobotics/webapp-container","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/leggedrobotics/webapp-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fwebapp-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fwebapp-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fwebapp-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fwebapp-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leggedrobotics","download_url":"https://codeload.github.com/leggedrobotics/webapp-container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fwebapp-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278710890,"owners_count":26032541,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["containers","docker","laravel","php","web"],"created_at":"2024-11-12T14:11:51.306Z","updated_at":"2025-10-07T02:44:36.130Z","avatar_url":"https://github.com/leggedrobotics.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"`webapp-container` 🐋\n===\n\nScripts and tools to run a PHP web-application - meaning [Laravel](https://laravel.com/), right now - in [Docker](https://www.docker.com/).\n\n**Note: This repository is supposed to be a Git submodule of a web application.**\n\nIngredients\n- [⛰️  Alpine](https://www.alpinelinux.org/)\n- [⚙️  PHP-FPM 7.4](https://php-fpm.org/)\n- [🌐 Nginx](https://nginx.org/en/)\n- [📮 Redis](https://redis.io/)\n- [👮 supervisord](http://supervisord.org/)\n\n💾 Setup\n---\n\nAssuming an initial repository where the (Laravel) application lives in a sub-directory.\nAdd the `webapp-docker` repository as a Git submodule. \nThen copy the example `Makefile` and `.dockerignore` file. \n\n```bash\n# Add submodule\ngit submodule add git@github.com:leggedrobotics/webapp-docker.git docker\n# Copy example files\ncp docker/dockerignore.example .dockerignore\ncp docker/Makefile.example Makefile\n```\n\nIn the Makefile, adjust the variables to reflect the name and directory of your app. \n\n```\nAPP_DIR = my-app\nAPP_NAME = my-app\n\n...\n```\n\n🧰 Development\n---\n\n```bash\n# build the development container\nmake build-development\n# install composer dependencies locally\nmake composer-install\n# install npm dependencies locally\nmake npm-install\n# generate development certificates, assumes ${APP_NAME}.test\n# override by setting APP_DOMAIN (env)var.\nmake dev-certs\n# start the development server\nmake development\n# watch assets\nmake npm-run-watch\n# start a shell session in the development container\nmake sh\n# start a Tinker (PHP REPL) session in the development container\nmake tinker\n```\n\n🧩 Extending\n---\n\nAdd features to the images or change behavior by adding Make targets or extending the images with Dockerfiles.\n\nVia a Dockerfile in the root of the project.\n\n```dockerfile\n# syntax = docker/dockerfile:1.0-experimental\nARG BASE_IMG=my-app-development-base\nFROM $BASE_IMG AS base\n\n# Extend the development base image with some extra packages\nRUN --mount=type=cache,target=/etc/apk/cache apk --update-cache add \\\n  php-mysqli \\\n  php-pdo_mysql\n```\n\nThen, adding to the `Makefile`:\n\n```\n# ... rest of the Makefile\ninclude docker/makefile.mk\n\nbuild-development: build-development-base\n\t${BUILD} -t ${APP_NAME}-development \\\n\t\t--target development \\\n\t\t.\n```\n\nNow, run `make build-development` and `make development` is usual\n\n\u003e **TODO** Adding `supervisord` services\n\n📦 Production\n---\n\nGetting ready for production by building a container that includes sources and compiled assets.\nExtend the `Dockerfile` and `Makefile` to accomodate the necessary steps.\n\nExample `Makefile`\n\n```makefile\n# ... rest of the Makefile\n\n# Build production by extending the base image \n# (target `build-base`, image name `${APP_NAME}-base`)\nbuild-production: build-base\n\t${BUILD} --target production \\\n\t\t--build-arg BASE_IMG=${APP_NAME}-base \\\n\t\t-t ${APP_NAME}-production \\\n\t\t.\n\nproduction: build-production\n\t${DOCKER} run -ti --rm \\\n\t\t--name ${APP_NAME}-production \\\n\t\t-p80:80 -p443:443 \\\n\t\t-v${APP_NAME}-certs:/certs \\\n\t\t-v${APP_NAME}-production-storage:/opt/storage \\\n\t\t${APP_NAME}-production\n```\n\nThen to run: \n```bash\n# build production container\nmake build-production\n# optionally, tag and push the container\n#  docker tag my-app-production my.registry.io/my-app\n#  docker push my.registry.io/my-app\n# test the production container locally\nmake production\n```\n\n🦭 Podman or other container tools\n---\n_The UTF-8 emoji for a Seal is not widely supported..._\n\nUsing [Podman](https://podman.io/) is simple due to the partial command-line compatibility. \n\n```bash\nDOCKER=podman BUILD=podman\\ build make development\n```\n\nOr set the environment variables in your `Makefile`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fwebapp-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleggedrobotics%2Fwebapp-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fwebapp-container/lists"}