Sign inSign up

usabilitydynamics/udx-worker-php

By usabilitydynamics

•Updated about 2 months ago

Powered by UDX Worker, this Docker image runs PHP apps on Nginx, streamlining dev and deployment.

Image
Security
Developer tools
Web servers
2

9.1K

usabilitydynamics/udx-worker-php repository overview

UDX Worker PHP

⁠UDX Worker PHP

Secure, containerized PHP runtime built on UDX Worker for repeatable web and automation workloads.

⁠Quick Reference

⁠Supported Tags

  • latest
  • Semantic version tags (recommended for CI/CD pinning)

⁠What It Is

UDX Worker PHP extends usabilitydynamics/udx-worker with a production-ready PHP stack: PHP-FPM + NGINX, supervised services, and the same secure runtime model used by the base image.

⁠Highlights

  • Runs as a non-root udx user by default.
  • Includes PHP 8.4 runtime (php-fpm, php-cli) with common extensions.
  • Ships with NGINX configured for app content at /var/www.
  • Uses worker-managed services with autostart for both php-fpm and nginx.
  • Keeps config/runtime behavior consistent across local, CI/CD, and Kubernetes.

⁠Quick Start

⁠1) Create Project Files
mkdir -p my-php-worker/.config/worker my-php-worker/app
cd my-php-worker

cat > app/index.php <<'PHP'
<?php
header('Content-Type: text/plain');
echo "udx-worker-php is running\n";
PHP
⁠2) Define Services
kind: workerService
version: udx.io/worker-v1/service
services:
  - name: "php-fpm"
    command: "/usr/local/bin/start-php-fpm.sh"
    autostart: true
    autorestart: true
    envs:
      - "PHP_VERSION=8.4"
  - name: "nginx"
    command: "/usr/local/bin/start-nginx.sh"
    autostart: true
    autorestart: true

Save this as .config/worker/services.yaml.

⁠3) Run the Container
docker run -d \
  --name my-php-worker \
  -p 8080:80 \
  -v "$(pwd)/.config/worker:/home/udx/.config/worker:ro" \
  -v "$(pwd)/app:/var/www" \
  usabilitydynamics/udx-worker-php:latest

docker logs -f my-php-worker

Then open: http://localhost:8080

⁠4) Inspect Services
docker exec my-php-worker worker service list
docker exec my-php-worker worker service logs php-fpm
docker exec my-php-worker worker service logs nginx

⁠Simplified Deployment With Worker CLI

Use Worker Deploy (@udx/worker-deployment) to replace long docker run flags with a simple deploy.yml + worker run workflow.

Installed CLI:

npm install -g @udx/worker-deployment
worker config
worker run

No-install (npx) mode:

npx @udx/worker-deployment worker config
npx @udx/worker-deployment worker run

If you prefer, you can also run the image directly with docker run.

Minimal deploy.yml:

kind: workerDeployConfig
version: udx.io/worker-v1/deploy
config:
  image: "usabilitydynamics/udx-worker-php:latest"
  volumes:
    - "./.config/worker:/home/udx/.config/worker:ro"
    - "./app:/var/www"

⁠Configuration Model

Runtime files (mounted inside container):

  • /home/udx/.config/worker/worker.yaml (runtime config, env, secrets)
  • /home/udx/.config/worker/services.yaml (long-running services)

Application files:

  • /var/www (your PHP application code)

⁠Supported Credential Env Vars

  • AZURE_CREDS
  • AWS_CREDS
  • GCP_CREDS

Values can be JSON, Base64-encoded JSON, or a file path.

⁠Typical Use Cases

  • Serve PHP web applications with secure defaults.
  • Run PHP scripts and CLI jobs in CI/CD pipelines.
  • Standardize PHP runtime behavior across dev, CI, and production.

⁠Documentation

⁠License

MIT License. See https://github.com/udx/worker-php/blob/latest/LICENSE⁠.

Tag summary

Content type

Image

Digest

sha256:17c825e69…

Size

339.8 MB

Last updated

about 2 months ago

docker pull usabilitydynamics/udx-worker-php