From 80c6ba621ecafca96e11440e353a9e7f22d8cf22 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 7 Jan 2025 13:42:20 +1100 Subject: [PATCH] feat: Update nixpacks config --- nixpacks.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixpacks.json b/nixpacks.json index c2337b2..2bdf687 100644 --- a/nixpacks.json +++ b/nixpacks.json @@ -1,12 +1,12 @@ { - "providers": [], + "providers": ["php"], "buildImage": "ghcr.io/railwayapp/nixpacks:ubuntu-1731369831", "variables": { "NIXPACKS_METADATA": "php", "PORT": "80" }, "staticAssets": { - "apache.template.conf": "\n ServerName localhost\n DocumentRoot \"${NIXPACKS_PHP_ROOT_DIR:-/app}\"\n\n \n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n \n\n \n SetHandler \"proxy:fcgi://127.0.0.1:9000\"\n \n\n ErrorLog /dev/stdout\n CustomLog /dev/stdout combined\n\n Header always set X-Frame-Options \"SAMEORIGIN\"\n Header always set X-Content-Type-Options \"nosniff\"\n\n RewriteEngine On\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^ index.php [QSA,L]\n\n \n Require all denied\n \n", + "apache.template.conf": "\n ServerName localhost\n DocumentRoot \"${NIXPACKS_PHP_ROOT_DIR:-/app}\"\n\n \n Options Indexes +FollowSymLinks +MultiViews\n AllowOverride All\n Require all granted\n \n\n \n SetHandler \"proxy:fcgi://127.0.0.1:9000\"\n \n\n ServerTokens Prod\n ServerSignature Off\n\n DirectoryIndex index.php\n AddType text/html php\n AddType application/x-httpd-php .php\n\n ErrorLog /dev/stdout\n CustomLog /dev/stdout combined\n\n Header always set X-Frame-Options \"SAMEORIGIN\"\n Header always set X-Content-Type-Options \"nosniff\"\n\n RewriteEngine On\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^ index.php [QSA,L]\n\n \n Require all denied\n \n\n", "php-fpm.conf": "[www]\nlisten = 127.0.0.1:9000\nuser = nobody\npm = dynamic\npm.max_children = 50\npm.min_spare_servers = 4\npm.max_spare_servers = 32\npm.start_servers = 18\nclear_env = no\ncatch_workers_output = yes\n", "scripts/config/template.mjs": "import { readFile, writeFile } from \"fs/promises\";\nimport { getNixPath } from \"../util/nix.mjs\";\n\nconst replaceStr = input =>\n input\n .replaceAll(/\\${(\\w+)}/g,\n (_all, name) => process.env[name]\n )\n .replaceAll(/\\$!{(\\w+)}/g,\n (_all, exe) => getNixPath(exe)\n )\n\nexport async function compileTemplate(infile, outfile) {\n await writeFile(outfile,\n replaceStr(await readFile(infile, { encoding: 'utf8' })),\n { encoding: 'utf8' })\n}\n", "scripts/prestart.mjs": "#!/usr/bin/env node\nimport { compileTemplate } from \"./config/template.mjs\";\nimport { e } from \"./util/cmd.mjs\";\n\nif (process.argv.length != 4) {\n console.error(`Usage: ${process.argv[1]} `);\n process.exit(1);\n}\n\nawait compileTemplate(process.argv[2], process.argv[3]);\nconsole.log(`Server starting on port ${process.env.PORT}`);\n",