PHP Basic Webserver
Summary
A minimal PHP web server using PHPs built-in server with a health check endpoint, Docker containerization, Kubernetes deployment manifests, and GitHub Actions CI/CD workflow.
A minimal PHP web server using PHP's built-in server. Displays "Hello World" with current time and date, and provides health check endpoints.
Quick Start
-
Update your terminal (tools were installed):
source ~/.bashrc -
Run the app:
php -S 0.0.0.0:3000 app/index.php -
Open in browser: http://localhost:3000
Prerequisites
Development tools are installed automatically by the devcontainer.
If you need to reinstall, run: dev-setup
Project Structure
After installation, your project contains:
├── app/
│ └── index.php # Main application
├── manifests/
│ ├── deployment.yaml # K8s Deployment + Service
│ └── kustomization.yaml # ArgoCD configuration
├── .github/
│ └── workflows/
│ └── urbalurba-build-and-push.yaml # CI/CD pipeline
├── Dockerfile # Container build (multi-stage)
├── TEMPLATE_INFO # Template metadata
└── README-php-basic-webserver.md # This file
Development
- Edit
app/index.php— the main application file - The
/endpoint returns "Hello World" with the template name and current time/date - Restart the server after changes (PHP's built-in server does not auto-reload)
Docker Build
docker build -t php-basic-webserver .
docker run -p 3000:3000 php-basic-webserver
Kubernetes Deployment
kubectl apply -k manifests/
The app will be accessible at http://<app-name>.localhost after ArgoCD registration.
CI/CD
The GitHub Actions workflow automatically builds and pushes the Docker image to GitHub Container Registry when changes are pushed to the main branch.