Skip to content

Latest commit

 

History

History
160 lines (108 loc) · 3.21 KB

File metadata and controls

160 lines (108 loc) · 3.21 KB

UDX Worker PHP

UDX Worker PHP

Docker Pulls License

PHP runtime image built on UDX Worker with NGINX + PHP-FPM preconfigured.

Quick StartUsageDevelopmentResources

Overview

udx-worker-php extends udx/worker and keeps the same worker runtime model while adding:

  • NGINX configured for /var/www
  • PHP-FPM (8.4) with socket-based NGINX integration
  • Worker service definitions that autostart both php-fpm and nginx

This image is intended as a base runtime for PHP applications and PHP-focused automation workloads.

Quick Start

Requirements: Docker (and Make if you want local dev commands).

Run from Docker Hub

docker run -d \
  --name my-php-app \
  -p 80:80 \
  -v "$(pwd)/my-php-app:/var/www" \
  usabilitydynamics/udx-worker-php:latest

Then open http://localhost (or your mapped host port).

Local Development Workflow

git clone https://github.com/udx/worker-php.git
cd worker-php

make build
make run
make log FOLLOW_LOGS=true

make run uses these defaults from Makefile.variables:

  • volume: ./src/scripts:/var/www
  • host/container port: 80:80
  • env file: .env

Usage

Mount your own app code

make run VOLUMES="$(pwd)/path-to-app:/var/www" HOST_PORT=8080

Run interactively

make run-it

Execute into the running container

make exec

Deploy with Worker CLI config

This repo includes a sample deploy.yml for @udx/worker-deployment.

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

Testing

Run all built-in tests:

make run-all-tests

Run full validation (build + tests):

make test

Run a specific test script:

make run-test TEST_SCRIPT=10_nginx_test.php

Current tests live in src/tests/ and cover:

  • NGINX HTTP response
  • PHP runtime availability
  • CLI execution
  • write permissions under /var/www

Configuration

Primary defaults are in Makefile.variables:

  • DOCKER_IMAGE
  • CONTAINER_NAME
  • HOST_PORT / CONTAINER_PORT
  • VOLUMES
  • PHP_VERSION

Container/runtime config files:

  • etc/configs/nginx/default.conf
  • etc/configs/php/php-fpm.conf
  • etc/configs/php/www.conf
  • etc/configs/worker/services.yaml

Development

Useful commands:

make help
make build
make run
make log
make clean
make test

Resources

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to your branch
  5. Open a pull request

Include relevant tests and documentation updates with your changes.

License

MIT. See LICENSE.