Skip to content

Commit

Permalink
Add NGINX Build and flexible configuration for fast cgi
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed May 24, 2024
1 parent f715738 commit 6476822
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Changes the server root. Defaults to `/var/www/html`.

If set, will enable the FastCGI pass to the PHP-FPM server. Defaults to `127.0.0.1:9000`

### PHP_FPM_IGNORE_ENV=true

If set, with any value, will ignore the system environment variables in the PHP FPM

### NGINX_SSL_CERT and NGINX_SSL_CERT_KEY

Expand Down
5 changes: 2 additions & 3 deletions generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ def build_cli(self, arch):
def build_fpm(self, arch):
self._banner("fpm")
container = self._from(self.source_repo(arch, "base"), arch)
self._run_cli(["buildah", "config", "--cmd", 'php-fpm --nodaemonize', container])
self._run_cli(["buildah", "config", "--cmd", '/start-fpm.sh', container])
self._run_cli(["buildah", "copy", container, "assets/fpm/conf/www.conf", "/etc/php{major}{minor}/php-fpm.d/www.conf".format(major=self.content["version"]["major"], minor=self.content["version"]["minor"])])
self._run_cli(["buildah", "copy", container, "assets/fpm/conf/base.conf", "/etc/php{major}{minor}/php-fpm.d/base.conf".format(major=self.content["version"]["major"], minor=self.content["version"]["minor"])])
self._run_cli(["buildah", "copy", container, "assets/script/start-fpm.sh", "/start-fpm.sh"])

return self._build(container, "fpm", arch)

Expand All @@ -137,7 +138,6 @@ def build_fpm_apache(self, arch):
self._run_cli(["buildah", "copy", container, "assets/fpm-apache/conf/vhost.conf", "/etc/apache2/conf.d/"])
self._run_cli(["buildah", "copy", container, "assets/fpm-apache/conf/supervisord.conf", "/etc/supervisord.conf"])
self._run_cli(["buildah", "copy", container, "assets/script/exit-event-listener.py", "/exit-event-listener.py"])
self._run_cli(["buildah", "copy", container, "assets/script/start-fpm.sh", "/start-fpm.sh"])
return self._build(container, "fpm-apache", arch)

def build_fpm_nginx(self, arch):
Expand All @@ -148,7 +148,6 @@ def build_fpm_nginx(self, arch):
self._run_cli(["buildah", "copy", container, "assets/fpm-nginx/conf/nginx.vh.default.conf", "/etc/nginx/http.d/default.conf"])
self._run_cli(["buildah", "copy", container, "assets/fpm-nginx/conf/supervisord.conf", "/etc/supervisord.conf"])
self._run_cli(["buildah", "copy", container, "assets/script/exit-event-listener.py", "/exit-event-listener.py"])
self._run_cli(["buildah", "copy", container, "assets/script/start-fpm.sh", "/start-fpm.sh"])
script = self.parse_config("php-fpm-nginx.j2", False)
with open(".tmp.sh", "w") as file:
file.write(script)
Expand Down

0 comments on commit 6476822

Please sign in to comment.