Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/nginx-unit flavour #164

Open
razvanphp opened this issue May 24, 2023 · 3 comments
Open

Feature/nginx-unit flavour #164

razvanphp opened this issue May 24, 2023 · 3 comments

Comments

@razvanphp
Copy link

Hello,

Since there are multiple tests online about how nginx-unit is faster than fpm+nginx combo + the added benefit of simplicity having just one container with no supervisord, would this repo be a good place to contribute this?

What would be the recommended approach? Have some tests added/run?

Thank you!
R

@samdark
Copy link
Member

samdark commented May 24, 2023

Likely yes but it would be great to have actual benchmarks.

@razvanphp
Copy link
Author

sure, here is what I was referring to: https://habr.com/en/articles/646397/

Also, our app runs fine in this environment/setup since the official unit image is based on the official php-cli image -- but we could also use it as a baseimage intermediate to pull the unitd binaries + modules from:

root@8418299f6480:/app# php -v
PHP 8.2.6 (cli) (built: May 23 2023 04:11:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.6, Copyright (c), by Zend Technologies
root@8418299f6480:/app#
root@8418299f6480:/app# unitd --version
unit version: 1.30.0
configured as ./configure --prefix=/usr --statedir=/var/lib/unit --control=unix:/var/run/control.unit.sock --pid=/var/run/unit.pid --log=/var/log/unit.log --tmpdir=/var/tmp --user=unit --group=unit --openssl --libdir=/usr/lib/aarch64-linux-gnu --njs --cc-opt='-g -O2 -ffile-prefix-map=/unit=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --ld-opt='-specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --modulesdir=/usr/lib/unit/modules
root@8418299f6480:/app# php requirements.php 

Yii Application Requirement Checker

This script checks if your server configuration meets the requirements
for running Yii application.
It checks if the server is running the right version of PHP,
if appropriate PHP extensions have been loaded, and if php.ini file settings are correct.

Check conclusion:
-----------------

PHP version: OK

Reflection extension: OK

PCRE extension: OK

SPL extension: OK

Ctype extension: OK

MBString extension: OK

OpenSSL extension: OK

Intl extension: OK

ICU version: OK

ICU Data version: OK

Fileinfo extension: OK

DOM extension: OK

IPv6 support: OK

PDO extension: OK

PDO SQLite extension: OK

PDO MySQL extension: OK

PDO PostgreSQL extension: WARNING!!!
Required by: All DB-related classes
Memo: Required for PostgreSQL database.

Memcache extension: WARNING!!!
Required by: MemCache

GD PHP extension with FreeType support: OK

ImageMagick PHP extension with PNG support: WARNING!!!
Required by: Captcha
Memo: Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required for image CAPTCHA.

Expose PHP: WARNING!!!
Required by: Security reasons
Memo: "expose_php" should be disabled at php.ini

PHP allow url include: OK

PHP mail SMTP: OK

------------------------------------------
Errors: 0   Warnings: 4   Total checks: 23

root@8418299f6480:/app#

@schmunk42
Copy link
Contributor

schmunk42 commented May 25, 2023

@razvanphp
Here's a very rough first "build layout":
https://github.com/yiisoft/yii2-docker/tree/feature/nginxunit

It builds, but the correct config is missing, you might start from there to create a working image.

It might be possible to re-unify the Dockerfiles, but this depends maily on the OS used in the Docker image.

PS:
Comment Apache section and uncomment https://github.com/yiisoft/yii2-docker/blob/feature/nginxunit/.env-dist#L26-L30 after files has been copied to .env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants