|
| 1 | +<!-- markdownlint-disable MD041 --> |
| 2 | +<p align="center"> |
| 3 | + <a href="https://github.com/yii2-extensions/docker-images" target="_blank"> |
| 4 | + <img src="https://www.yiiframework.com/image/yii_logo_light.svg" alt="Yii Framework"> |
| 5 | + </a> |
| 6 | + <h1 align="center">Docker images</h1> |
| 7 | + <br> |
| 8 | +</p> |
| 9 | +<!-- markdownlint-enable MD041 --> |
| 10 | + |
| 11 | +Production-ready Docker images for Yii2 applications with Apache, PHP-FPM, and HTTP/2 support. |
| 12 | + |
| 13 | +## Features |
| 14 | + |
| 15 | +- ✅ **Apache 2.4** with HTTP/2, Brotli compression, and SSL/TLS |
| 16 | +- ✅ **Auto SSL** certificate generation for development |
| 17 | +- ✅ **Health checks** and monitoring endpoints |
| 18 | +- ✅ **PHP 8.4** with FPM and essential extensions (Redis, MongoDB, MySQL, PostgreSQL) |
| 19 | +- ✅ **Security hardened** with modern configurations |
| 20 | +- ✅ **Supervisor** for process management |
| 21 | +- ✅ **Three build variants**: `dev`, `prod`, and `full` |
| 22 | + |
| 23 | +### Quick Start |
| 24 | + |
| 25 | +Pull and run the image. |
| 26 | + |
| 27 | +```bash |
| 28 | +# Development build with Xdebug |
| 29 | +docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 |
| 30 | + |
| 31 | +# Production build with optimizations |
| 32 | +docker run -d -p 80:80 -p 443:443 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-prod-v1.0.0 |
| 33 | + |
| 34 | +# Full testing build with all extensions |
| 35 | +docker run -d -p 8080:80 -v $(pwd):/var/www/app ghcr.io/yii2-extensions/apache:8.4-debian-full-v1.0.0 |
| 36 | +``` |
| 37 | + |
| 38 | +### Docker Compose |
| 39 | + |
| 40 | +Create a `docker-compose.yml` file. |
| 41 | + |
| 42 | +<!-- editorconfig-checker-disable --> |
| 43 | +<!-- prettier-ignore-start --> |
| 44 | +```yaml |
| 45 | +version: '3.8' |
| 46 | + |
| 47 | +services: |
| 48 | + web: |
| 49 | + image: ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 |
| 50 | + ports: |
| 51 | + - "8080:80" |
| 52 | + - "8443:443" |
| 53 | + volumes: |
| 54 | + - .:/var/www/app |
| 55 | + environment: |
| 56 | + - YII_ENV=dev |
| 57 | + - YII_DEBUG=1 |
| 58 | +``` |
| 59 | +<!-- prettier-ignore-end --> |
| 60 | +<!-- editorconfig-checker-enable --> |
| 61 | +
|
| 62 | +### Build Variants |
| 63 | +
|
| 64 | +#### Development (`dev`) |
| 65 | + |
| 66 | +```bash |
| 67 | +docker pull ghcr.io/yii2-extensions/apache:8.4-debian-dev-v1.0.0 |
| 68 | +``` |
| 69 | + |
| 70 | +- Error reporting enabled with detailed logging |
| 71 | +- Node.js integration for asset compilation |
| 72 | +- OPcache with revalidation for development workflow |
| 73 | +- PHP `8.4` with Xdebug, Memcached, MongoDB, SOAP, YAML |
| 74 | + |
| 75 | +#### Production (`prod`) |
| 76 | + |
| 77 | +```bash |
| 78 | +docker pull ghcr.io/yii2-extensions/apache:8.4-debian-prod-v1.0.0 |
| 79 | +``` |
| 80 | + |
| 81 | +- Minimal extension set with maximum performance |
| 82 | +- OPcache optimizations with disabled timestamp validation |
| 83 | +- Optimized for container orchestration platforms |
| 84 | +- Security hardening with reduced attack surface |
| 85 | + |
| 86 | +#### Full Testing (`full`) |
| 87 | + |
| 88 | +```bash |
| 89 | +docker pull ghcr.io/yii2-extensions/apache:8.4-debian-full-v1.0.0 |
| 90 | +``` |
| 91 | + |
| 92 | +- All development extensions plus OCI8, SQL Server, Tidy |
| 93 | +- Complete extension matrix for comprehensive testing |
| 94 | +- Microsoft SQL Server ODBC drivers and PDO support |
| 95 | +- Production-like optimizations with development tools |
| 96 | + |
| 97 | +## Package information |
| 98 | + |
| 99 | +[](https://github.com/yii2-extensions/docker-images/actions/workflows/build.yml) |
| 100 | +[](https://github.com/yii2-extensions/docker-images/releases) |
| 101 | + |
| 102 | +## Quality code |
| 103 | + |
| 104 | +[](https://github.com/yii2-extensions/docker-images/actions/workflows/linter.yml) |
| 105 | + |
| 106 | +## Our social networks |
| 107 | + |
| 108 | +[](https://x.com/Terabytesoftw) |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +[](LICENSE) |
0 commit comments