{"id":28472045,"url":"https://github.com/parallax/k8s-openresty-php","last_synced_at":"2025-07-01T22:30:53.293Z","repository":{"id":41049453,"uuid":"211053361","full_name":"parallax/k8s-openresty-php","owner":"parallax","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-24T08:02:31.000Z","size":315,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T00:11:21.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Roff","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/parallax.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":"2019-09-26T09:38:06.000Z","updated_at":"2025-04-24T08:02:35.000Z","dependencies_parsed_at":"2025-03-05T10:20:35.016Z","dependency_job_id":"f1a264f9-0cc6-4cc2-a95a-46a0a011744a","html_url":"https://github.com/parallax/k8s-openresty-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/parallax/k8s-openresty-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Fk8s-openresty-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Fk8s-openresty-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Fk8s-openresty-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Fk8s-openresty-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parallax","download_url":"https://codeload.github.com/parallax/k8s-openresty-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parallax%2Fk8s-openresty-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046060,"owners_count":23405126,"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":[],"created_at":"2025-06-07T11:09:46.673Z","updated_at":"2025-07-01T22:30:53.241Z","avatar_url":"https://github.com/parallax.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-openresty-php\n\n\u003e A set of relatively clean but full-featured, split solution to running openresty and php-fpm together but in seperate containers, supporting PHP versions 5.6, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 and 8.2 maintained by [Parallax](https://parall.ax/)\n\n## Docker Tags \n|openresty      | Docker tag                                      |\n| ------------- | -------------                                   |\n| 1.15.8.2      | prlx/k8s-openresty-php-openresty:release-latest |\n\n| PHP           | Docker Tag                                          |\n| ------------- | -------------                                       |\n| 5.6           | prlx/k8s-openresty-php-php:release-php-5.6-latest   |\n| 7.1           | prlx/k8s-openresty-php-php:release-php-7.1-latest   |\n| 7.2           | prlx/k8s-openresty-php-php:release-php-7.2-latest   |\n| 7.3           | prlx/k8s-openresty-php-php:release-php-7.3-latest   |\n| 7.4           | prlx/k8s-openresty-php-php:release-php-7.4-latest   |\n| 8.0           | prlx/k8s-openresty-php-php:release-php-8.0-latest   |\n| 8.1           | prlx/k8s-openresty-php-php:release-php-8.1-latest   |\n| 8.2           | prlx/k8s-openresty-php-php:release-php-8.2-latest   |\n\n## Browse all tags on Docker Hub\n[Openresty](https://hub.docker.com/r/prlx/k8s-openresty-php-openresty)\n\n[PHP](https://hub.docker.com/r/prlx/k8s-openresty-php-php)\n\n# Environment Variables\n\nThese containers work with certain environment variables to control their operation. Environment variables marked as required may be omitted and things may seem to work OK but we do not test against omitting these so you may see some pretty interesting behaviour as a result.\n\nWeb/Worker just means whether these have any effect - nothing bad will happen if they are set on both.\n\nFor help running these locally with docker run see the [docker run reference](https://docs.docker.com/engine/reference/run/#env-environment-variables)\n\n| Key                                | Description                                                                                                     | Required | Web | Worker |\n| ---                                | ---                                                                                                             | ---      | --- | ---    |\n| SITE_NAME                          | The name of your project, i.e. 'mywebsite'. Used by NR for app name.                                            | ✓        | ✓   | ✓      |\n| SITE_BRANCH                        | The running branch of your project, i.e. 'master'. Used by NR for app name.                                     | ✓        | ✓   | ✓      |\n| ENVIRONMENT                        | The environment you're running in, i.e. 'qa' or 'production'. Used by NR for app name.                          | ✓        | ✓   | ✓      |\n| ATATUS_APM_LICENSE_KEY             | Your Atatus license key. Atatus won't be used if this is not set.                                               | ✖        | ✓   | ✓      |\n| ATATUS_FRAMEWORK                   | Manually set the Atatus framework (see Atatus docs, typically \"Laravel\" or \"Symfony\")                           | ✖        | ✓   | ✓      |\n| ATATUS_APM_RAW_SQL                 | Set to any value (1, true, etc) to use raw sql logging into Atatus                                              | ✖        | ✓   | ✓      |\n| PHP_MEMORY_MAX                     | Maximum PHP request memory, in megabytes (i.e. '256'). Defaults to 128.                                         | ✖        | ✓   | ✓      |\n| MAX_EXECUTION_TIME                 | Maximum PHP and Nginx execution/fastcgi read timeout\t                                                           | ✖        | ✓   | ✓      |\n| PHP_FPM_WORKERS                    | Maximum PHP-FPM workers. Defaults to 4 if not set.                                                              | ✖        | ✓   | ✖      |\n| PHP_FPM_USER                       | User which PHP-FPM workers are started as. Defaults to nobody.                                                  | ✖        | ✓   | ✖      |\n| PHP_FPM_GROUP                      | Group which PHP-FPM workers are started as. Defaults to nobody.                                                 | ✖        | ✓   | ✖      |\n| DISABLE_OPCACHE                    | Set to any value (1, true, etc) to disable PHP Opcache                                                          | ✖        | ✓   | ✓      |\n| PHP_OPCACHE_MEMORY                 | Maximum PHP request memory, in megabytes (i.e. '64'). Defaults to 16.                                           | ✖        | ✓   | ✓      |\n| PHP_OPCACHE_INTERNED_STRING_BUFFER | Maximum PHP interned string buffer memory, in megabytes (i.e. '16'). Defaults to 2.                             | ✖        | ✓   | ✓      |\n| PHP_SESSION_STORE                  | If not set, PHP uses /tmp for sessions. If set to 'redis', uses redis for sessions                              | ✖        | ✓   | ✓      |\n| PHP_SESSION_STORE_REDIS_HOST       | If not set, defaults to 'redis'. Only used if PHP_SESSION_STORE is set to redis                                 | ✖        | ✓   | ✓      |\n| PHP_SESSION_STORE_REDIS_PORT       | If not set, defaults to 6379. Only used if PHP_SESSION_STORE is set to redis                                    | ✖        | ✓   | ✓      |\n| PHP_DISABLE_CACHE_HEADERS          | Set to any value (1, true, etc) to disable PHP's default pragma: no-cache headers                               | ✖        | ✓   | ✖      |\n| PHP_ENABLE_SHORT_TAGS              | Set to any value (1, true, etc) to enable PHP short tagging                                                     | ✖        | ✓   | ✓      |\n\n# The web mode/command\n\nThe web mode is what you use to run a web server - unless you're using workers this is the only one you'll be using. It runs all the things you need to be able to run a PHP-FPM container in Kubernetes.\n\nIt is also the default behaviour for the docker containers meaning you don't need to specify a command or working directory to run.\n\n## Ports and Services\n\n| Service                                                                                  | Description                                             | Port/Socket         |\n| -------------                                                                            | -------------                                           | -------------       |\n| [Openresty](https://openresty.org/)                                                      | Web server                                              | 0.0.0.0:80          |\n| [PHP-FPM](https://php-fpm.org/)                                                          | PHP running as a pool of workers                        | 127.0.0.1:9000       |\n\n## K8s Example\n\n### deployment.yaml\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    cluster-autoscaler.kubernetes.io/safe-to-evict: \"true\"\n  labels:\n    app: 'k8s-openresty-php-74-test'\n  name: 'k8s-openresty-php-74-test'\n  namespace: k8s-openresty-php\nspec:\n  progressDeadlineSeconds: 600\n  replicas: 1\n  revisionHistoryLimit: 1\n  selector:\n    matchLabels:\n      app: 'k8s-openresty-php-74-test'\n  strategy:\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0\n    type: RollingUpdate\n  template:\n    metadata:\n      annotations:\n        cluster-autoscaler.kubernetes.io/safe-to-evict: \"true\"\n      labels:\n        app: 'k8s-openresty-php-74-test'\n    spec:\n      volumes:\n        - name: shared-files\n          emptyDir: {}\n        - name: uploads\n          emptyDir: {}\n      containers:\n      - name: php\n        image: '{{ PHP7.4IMAGEHERE }}'\n        imagePullPolicy: IfNotPresent\n        livenessProbe:\n          failureThreshold: 1\n          exec:\n            command:\n            - /healthcheck.sh\n            - --listen-queue=10 # fails if there are more than 10 processes waiting in the fpm queue\n          initialDelaySeconds: 10\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 5\n        readinessProbe:\n          failureThreshold: 1\n          exec:\n            command:\n            - /healthcheck.sh\n          initialDelaySeconds: 10\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 5\n        resources:\n          limits:\n            cpu: \"1\"\n            memory: 512Mi\n          requests:\n            cpu: 50m\n            memory: 64Mi\n        volumeMounts:\n          - name: shared-files\n            mountPath: /src-shared\n          - name: uploads\n            mountPath: /var/nginx-uploads\n      - name: openresty\n        image: '{{ OPENRESTYIMAGEHERE }}'\n        imagePullPolicy: IfNotPresent\n        livenessProbe:\n          failureThreshold: 3\n          httpGet:\n            path: /healthz\n            port: openresty\n            scheme: HTTP\n          initialDelaySeconds: 10\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 1\n        readinessProbe:\n          failureThreshold: 3\n          httpGet:\n            path: /healthz\n            port: openresty\n            scheme: HTTP\n          initialDelaySeconds: 10\n          periodSeconds: 5\n          successThreshold: 2\n          timeoutSeconds: 2\n        ports:\n        - containerPort: 80\n          name: openresty\n          protocol: TCP\n        resources:\n          limits:\n            cpu: \"1\"\n            memory: 512Mi\n          requests:\n            cpu: 50m\n            memory: 64Mi\n        volumeMounts:\n          - name: shared-files\n            mountPath: /src-shared\n          - name: uploads\n            mountPath: /var/nginx-uploads\n      dnsPolicy: ClusterFirst\n      restartPolicy: Always\n      terminationGracePeriodSeconds: 20\n```\n### service.yaml\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: 'openresty-74-test'\n  namespace: k8s-openresty-php\nspec:\n  ports:\n  - name: openresty\n    port: 80\n    protocol: TCP\n    targetPort: 80\n  selector:\n    app: 'k8s-openresty-php-74-test'\n  sessionAffinity: None\n  type: ClusterIP\n```\n\n# Custom Startup Scripts\n\nYou can add behaviour to the built-in startup scripts for web, worker or both modes by adding a file to:\n\n| File Path          | Runs on |\n| ---                | ---     |\n| /start.sh          | Web     |\n| /start-worker.sh   | Worker  |\n| /start-cron.sh     | Cron    |\n\n# The worker mode/command\n\nThe worker will run php artisan queue:work --timeout=$WORKER_TIMEOUT --tries=$WORKER_TRIES.\n\nTo run in this mode, change the Docker CMD to be /start-worker.sh instead of the default /start-web.sh.\n\n# PHP Modules\n| Module | 5.6 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n|  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| apc | ✓ | ✖ | ✖ | ✖ | ✖ | ✖ | ✖ |\n| apcu | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| atatus | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✖ |\n| bcmath | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| bz2 | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| calendar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| Core | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| ctype | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| curl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| date | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| dom | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| ereg | ✓ | ✖ | ✖ | ✖ | ✖ | ✖ | ✖ |\n| exif | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| fileinfo | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| filter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| ftp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| gd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| gettext | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| hash | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| iconv | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| igbinary | ✖ | ✖ | ✖ | ✖ | ✓ | ✓ | ✓ |\n| imagick | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| intl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| json | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| ldap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| libxml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| mbstring | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| mcrypt | ✓ | ✖ | ✖ | ✖ | ✖ | ✖ | ✖ |\n| memcached | ✖ | ✓ | ✓ | ✓ | ✓ | ✖ | ✖ |\n| mysql | ✓ | ✖ | ✖ | ✖ | ✖ | ✖ | ✖ |\n| mysqli | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| mysqlnd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| openssl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| pcntl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| pcre | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| PDO | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| pdo_mysql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| pdo_sqlite | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| Phar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| phpdbg_webhelper | ✖ | ✓ | ✓ | ✓ | ✖ | ✖ | ✖ |\n| posix | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| readline | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| redis | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| Reflection | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| session | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| shmop | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| SimpleXML | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| soap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sockets | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sodium | ✖ | ✖ | ✖ | ✖ | ✖ | ✖ | ✓ |\n| SPL | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sqlite3 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| standard | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sysvmsg | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sysvsem | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| sysvshm | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| tidy | ✖ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| tokenizer | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| wddx | ✓ | ✓ | ✓ | ✓ | ✖ | ✖ | ✖ |\n| xml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| xmlreader | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| xmlrpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✖ | ✖ |\n| xmlwriter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| xsl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| Zend OPcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| zip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| zlib | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallax%2Fk8s-openresty-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparallax%2Fk8s-openresty-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparallax%2Fk8s-openresty-php/lists"}