]> juplo.de Git - website/commitdiff
WIP:wordpress
authorKai Moritz <kai@juplo.de>
Mon, 17 Nov 2025 21:12:31 +0000 (22:12 +0100)
committerKai Moritz <kai@juplo.de>
Mon, 17 Nov 2025 21:12:31 +0000 (22:12 +0100)
docker-compose.yml
wordpress/wp-config.php [new file with mode: 0644]

index c38f8c34a6ac32ce5eda5fd5af24f62fc2cf74c0..1780a9883be402e3207dc68a0df189a49043bfce 100644 (file)
@@ -8,6 +8,7 @@ services:
       - ./:/usr/share/nginx/html:ro
   wordpress:
     image: wordpress:6.3.2-php8.2-apache
+    read_only: true
     depends_on:
       - mariadb
     environment:
@@ -15,6 +16,9 @@ services:
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: I0vAUXKC
       WORDPRESS_DB_NAME: wp_juplo
+      WORDPRESS_DB_CHARSET: latin1
+      WORDPRESS_DB_COLLATE: latin1_general_ci
+      WORDPRESS_SECRET_KEY: vTelcON5v26YTrdtKfMvyYFuetRwaWyK2K4tfalgpr
     volumes:
       - ./wordpress:/var/www/html
     ports:
diff --git a/wordpress/wp-config.php b/wordpress/wp-config.php
new file mode 100644 (file)
index 0000000..7e7472c
--- /dev/null
@@ -0,0 +1,133 @@
+<?php\r
+/**\r
+ * The base configuration for WordPress\r
+ *\r
+ * The wp-config.php creation script uses this file during the installation.\r
+ * You don't have to use the web site, you can copy this file to "wp-config.php"\r
+ * and fill in the values.\r
+ *\r
+ * This file contains the following configurations:\r
+ *\r
+ * * Database settings\r
+ * * Secret keys\r
+ * * Database table prefix\r
+ * * ABSPATH\r
+ *\r
+ * This has been slightly modified (to read environment variables) for use in Docker.\r
+ *\r
+ * @link https://wordpress.org/documentation/article/editing-wp-config-php/\r
+ *\r
+ * @package WordPress\r
+ */\r
+\r
+// IMPORTANT: this file needs to stay in-sync with https://github.com/WordPress/WordPress/blob/master/wp-config-sample.php\r
+// (it gets parsed by the upstream wizard in https://github.com/WordPress/WordPress/blob/f27cb65e1ef25d11b535695a660e7282b98eb742/wp-admin/setup-config.php#L356-L392)\r
+\r
+// a helper function to lookup "env_FILE", "env", then fallback\r
+if (!function_exists('getenv_docker')) {\r
+       // https://github.com/docker-library/wordpress/issues/588 (WP-CLI will load this file 2x)\r
+       function getenv_docker($env, $default) {\r
+               if ($fileEnv = getenv($env . '_FILE')) {\r
+                       return rtrim(file_get_contents($fileEnv), "\r\n");\r
+               }\r
+               else if (($val = getenv($env)) !== false) {\r
+                       return $val;\r
+               }\r
+               else {\r
+                       return $default;\r
+               }\r
+       }\r
+}\r
+\r
+// ** Database settings - You can get this info from your web host ** //\r
+/** The name of the database for WordPress */\r
+define( 'DB_NAME', getenv_docker('WORDPRESS_DB_NAME', 'wordpress') );\r
+\r
+/** Database username */\r
+define( 'DB_USER', getenv_docker('WORDPRESS_DB_USER', 'example username') );\r
+\r
+/** Database password */\r
+define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'example password') );\r
+\r
+/**\r
+ * Docker image fallback values above are sourced from the official WordPress installation wizard:\r
+ * https://github.com/WordPress/WordPress/blob/1356f6537220ffdc32b9dad2a6cdbe2d010b7a88/wp-admin/setup-config.php#L224-L238\r
+ * (However, using "example username" and "example password" in your database is strongly discouraged.  Please use strong, random credentials!)\r
+ */\r
+\r
+/** Database hostname */\r
+define( 'DB_HOST', getenv_docker('WORDPRESS_DB_HOST', 'mysql') );\r
+\r
+/** Database charset to use in creating database tables. */\r
+define( 'DB_CHARSET', getenv_docker('WORDPRESS_DB_CHARSET', 'utf8') );\r
+\r
+/** The database collate type. Don't change this if in doubt. */\r
+define( 'DB_COLLATE', getenv_docker('WORDPRESS_DB_COLLATE', '') );\r
+\r
+/**#@+\r
+ * Authentication unique keys and salts.\r
+ *\r
+ * Change these to different unique phrases! You can generate these using\r
+ * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.\r
+ *\r
+ * You can change these at any point in time to invalidate all existing cookies.\r
+ * This will force all users to have to log in again.\r
+ *\r
+ * @since 2.6.0\r
+ */\r
+define( 'AUTH_KEY',         getenv_docker('WORDPRESS_AUTH_KEY',         'put your unique phrase here') );\r
+define( 'SECURE_AUTH_KEY',  getenv_docker('WORDPRESS_SECURE_AUTH_KEY',  'put your unique phrase here') );\r
+define( 'LOGGED_IN_KEY',    getenv_docker('WORDPRESS_LOGGED_IN_KEY',    'put your unique phrase here') );\r
+define( 'NONCE_KEY',        getenv_docker('WORDPRESS_NONCE_KEY',        'put your unique phrase here') );\r
+define( 'AUTH_SALT',        getenv_docker('WORDPRESS_AUTH_SALT',        'put your unique phrase here') );\r
+define( 'SECURE_AUTH_SALT', getenv_docker('WORDPRESS_SECURE_AUTH_SALT', 'put your unique phrase here') );\r
+define( 'LOGGED_IN_SALT',   getenv_docker('WORDPRESS_LOGGED_IN_SALT',   'put your unique phrase here') );\r
+define( 'NONCE_SALT',       getenv_docker('WORDPRESS_NONCE_SALT',       'put your unique phrase here') );\r
+// (See also https://wordpress.stackexchange.com/a/152905/199287)\r
+\r
+/**#@-*/\r
+\r
+/**\r
+ * WordPress database table prefix.\r
+ *\r
+ * You can have multiple installations in one database if you give each\r
+ * a unique prefix. Only numbers, letters, and underscores please!\r
+ */\r
+$table_prefix = getenv_docker('WORDPRESS_TABLE_PREFIX', 'wp_');\r
+\r
+/**\r
+ * For developers: WordPress debugging mode.\r
+ *\r
+ * Change this to true to enable the display of notices during development.\r
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG\r
+ * in their development environments.\r
+ *\r
+ * For information on other constants that can be used for debugging,\r
+ * visit the documentation.\r
+ *\r
+ * @link https://wordpress.org/documentation/article/debugging-in-wordpress/\r
+ */\r
+define( 'WP_DEBUG', !!getenv_docker('WORDPRESS_DEBUG', '') );\r
+\r
+/* Add any custom values between this line and the "stop editing" line. */\r
+\r
+// If we're behind a proxy server and using HTTPS, we need to alert WordPress of that fact\r
+// see also https://wordpress.org/support/article/administration-over-ssl/#using-a-reverse-proxy\r
+if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {\r
+       $_SERVER['HTTPS'] = 'on';\r
+}\r
+// (we include this by default because reverse proxying is extremely common in container environments)\r
+\r
+if ($configExtra = getenv_docker('WORDPRESS_CONFIG_EXTRA', '')) {\r
+       eval($configExtra);\r
+}\r
+\r
+/* That's all, stop editing! Happy publishing. */\r
+\r
+/** Absolute path to the WordPress directory. */\r
+if ( ! defined( 'ABSPATH' ) ) {\r
+       define( 'ABSPATH', __DIR__ . '/' );\r
+}\r
+\r
+/** Sets up WordPress vars and included files. */\r
+require_once ABSPATH . 'wp-settings.php';\r