-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
270 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# WordPress Database Settings | ||
WORDPRESS_DB_HOST=mysql | ||
WORDPRESS_DB_USER=wordpress | ||
WORDPRESS_DB_PASSWORD=your_strong_password_here | ||
WORDPRESS_DB_NAME=wordpress | ||
WORDPRESS_TABLE_PREFIX=wp_wordpress | ||
|
||
# WordPress Source URL (optional, uncomment to use) | ||
# WORDPRESS_SOURCE_URL=https://wordpress.org/latest.zip | ||
|
||
# WordPress Database Import URL (optional, uncomment to use) | ||
# WORDPRESS_DB_URL=http://example.com/path/to/your/database_dump.sql | ||
|
||
# WordPress Authentication Unique Keys and Salts | ||
# Generate these using: https://api.wordpress.org/secret-key/1.1/salt/ | ||
WORDPRESS_AUTH_KEY='put your unique phrase here' | ||
WORDPRESS_SECURE_AUTH_KEY='put your unique phrase here' | ||
WORDPRESS_LOGGED_IN_KEY='put your unique phrase here' | ||
WORDPRESS_NONCE_KEY='put your unique phrase here' | ||
WORDPRESS_AUTH_SALT='put your unique phrase here' | ||
WORDPRESS_SECURE_AUTH_SALT='put your unique phrase here' | ||
WORDPRESS_LOGGED_IN_SALT='put your unique phrase here' | ||
WORDPRESS_NONCE_SALT='put your unique phrase here' | ||
|
||
# WordPress Debug Mode (set to true for development, false for production) | ||
WORDPRESS_DEBUG=false | ||
|
||
# Extra WordPress Configuration (optional, uncomment and modify as needed) | ||
# WORDPRESS_CONFIG_EXTRA="define( 'WP_MEMORY_LIMIT', '256M' );" | ||
|
||
# FrankenPHP specific settings (if any) | ||
# Add any FrankenPHP specific environment variables here | ||
|
||
# Other optional settings | ||
# Uncomment and set these if needed for your specific setup | ||
# WORDPRESS_SITE_URL=https://your-domain.com | ||
# WORDPRESS_HOME=https://your-domain.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
description = "FrankenPHP with latest PHP versions"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
# frankenwp = { | ||
# url = "github:StephenMiracle/frankenwp"; | ||
# flake = false; | ||
# }; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
(final: prev: { | ||
phpCommonConfig = { | ||
embedSupport = true; | ||
ztsSupport = true; | ||
apxs2Support = false; | ||
systemdSupport = false; | ||
phpdbgSupport = false; | ||
cgiSupport = false; | ||
fpmSupport = false; | ||
}; | ||
|
||
optimizePhp = phpPackage: (phpPackage.override final.phpCommonConfig).withExtensions | ||
({ all, ... }: with all; [ | ||
curl dom exif fileinfo gd iconv imagick intl | ||
mbstring mysqli opcache openssl sodium xml zip | ||
]); | ||
|
||
php81Optimized = final.optimizePhp prev.php81; | ||
php82Optimized = final.optimizePhp prev.php82; | ||
php83Optimized = final.optimizePhp prev.php83; | ||
|
||
buildwordpress-php = { php, name }: | ||
final.dockerTools.buildLayeredImage { | ||
inherit name; | ||
tag = "latest"; | ||
contents = [ | ||
final.frankenphp | ||
php | ||
final.busybox | ||
final.cacert | ||
final.curl | ||
final.ghostscript | ||
final.libxml2 | ||
final.mariadb.client | ||
final.unzip | ||
]; | ||
extraCommands = '' | ||
mkdir -p var/www/html usr/bin | ||
cp ${./wp-config.php} wp-config.php | ||
cp ${./docker-entrypoint.sh} docker-entrypoint.sh | ||
chmod +x docker-entrypoint.sh | ||
ln -s ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt etc/ssl/certs/ca-certificates.crt | ||
ln -s ${pkgs.busybox}/bin/sh usr/bin/bash | ||
''; | ||
config = { | ||
Entrypoint = [ "/docker-entrypoint.sh" ]; | ||
Cmd = [ "frankenphp" "php-server" "--root" "/var/www/html" "--listen" "0.0.0.0:80" ]; | ||
ExposedPorts = { | ||
"80/tcp" = {}; | ||
}; | ||
Env = [ | ||
"PHP_INI_DIR=/usr/local/etc/php" | ||
"WORDPRESS_VERSION=latest" | ||
"WORDPRESS_SHA1=" | ||
"WORDPRESS_DB_HOST=localhost" | ||
"WORDPRESS_DB_USER=wordpress" | ||
"WORDPRESS_DB_PASSWORD=wordpress" | ||
"WORDPRESS_DB_NAME=wordpress" | ||
"WORDPRESS_TABLE_PREFIX=wp_" | ||
]; | ||
}; | ||
}; | ||
}) | ||
]; | ||
}; | ||
in { | ||
packages = { | ||
wordpress-php81 = pkgs.buildwordpress-php { | ||
php = pkgs.php81Optimized; | ||
name = "wordpress-php81"; | ||
}; | ||
wordpress-php82 = pkgs.buildwordpress-php { | ||
php = pkgs.php82Optimized; | ||
name = "wordpress-php82"; | ||
}; | ||
wordpress-php83 = pkgs.buildwordpress-php { | ||
php = pkgs.php83Optimized; | ||
name = "wordpress-php83"; | ||
}; | ||
}; | ||
} | ||
); | ||
} |