Update installation procedure

This commit is contained in:
2026-11-27 16:24:48 +00:00
parent b8d9ff0b35
commit 3dc7c25dc2
7 changed files with 78 additions and 47 deletions
+21 -9
View File
@@ -1,12 +1,24 @@
STAGE=production
BASE_URL=http://localhost:63000
database_driver = mysql
database_host = mysql
database_database = plugi
database_username = plugi
database_password = plugi
database_charset = utf8
database_collation = utf8_unicode_ci
database_prefix =
DATABASE_DRIVER=mysql
DATABASE_HOST=mysql
DATABASE_DATABASE=plugi
DATABASE_USERNAME=plugi
DATABASE_PASSWORD=change-me
DATABASE_CHARSET=utf8mb4
DATABASE_PREFIX=
MYSQL_ROOT_PASSWORD=change-me-root
USERNAME=admin
PASSWORD = admin
PASSWORD=
PASSWORD_HASH=
MAIL_HOST=
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
MAIL_TIMEOUT=10
+1 -1
View File
@@ -12,11 +12,11 @@ dist-ssr
*.local
.env
/config.php
cache
uploads
extensions/dev_*
docs
.agents
skills-lock.json
+2 -3
View File
@@ -2,9 +2,8 @@ FROM php:8.4-apache-bookworm
WORKDIR "/var/www/html"
RUN apt-get update; \
docker-php-ext-install pdo pdo_mysql; \
docker-php-ext-install pdo_mysql; \
apt-get -y --no-install-recommends install \
git \
php8.4-mysql; \
git; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
+13 -14
View File
@@ -2,24 +2,23 @@
> A fork of [PHPagebuilder](https://github.com/HansSchouten/PHPagebuilder) by [Hans Schouten](https://github.com/HansSchouten).
> Still a work-in-progress
Plugi is a website boilerplate with a drag-and-drop page builder.
This boilerplate defines the project structure for quickly creating a website that can be managed with a drag and drop
pagebuilder.
## Quick installation
## Installation
1. Use PHP 8.4 with the PDO MySQL extension and a MySQL 8 database. The supplied Docker image is based on PHP 8.4.
2. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`; set the database connection, public `BASE_URL`, and a unique admin username and password hash in `.env`.
3. Create the database and a database user, deploy the project at the web root, and make `uploads/` writable by the web server.
4. Open the site, sign in at `/admin/auth`, and follow the Website Manager database update prompt to create/update the schema.
To setup your website download the latest version of Plugi and upload it to the webroot directory of your website.
See [the installation guide](docs/installation.md) for manual deployment, Docker development, security, and troubleshooting details.
### Edit the config file
The file `config.php` holds all the basic configuration for your project. Edit as needed. Be sure to update the
login-credentials.
## Local Docker development
### Login
Now you should be able to log in to the admin panel by going to the `/admin` URL of your website using `admin` and
`admin` (you can change these in the config file). If you are able to login you can start building your website.
The supplied Compose stack uses PHP 8.4 and MySQL 8.0 and is for local development only. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`, replace the sample database and MySQL root passwords, then run:
Note: make sure to disable error reporting in `index.php` once your website goes into production!
```sh
docker compose up --build -d
```
## Docker
Simply run `docker-compose up -d` using the supplied `docker-compose.yml`. The image uses PHP 8.2
The app is available at `http://localhost:63000`; Adminer is bound to localhost at `http://localhost:63001`.
+9 -9
View File
@@ -20,7 +20,7 @@ return [
| Storage settings
|--------------------------------------------------------------------------
|
| Database and file storage settings.
| File storage settings.
|
*/
'storage' => [
@@ -161,14 +161,14 @@ return [
'mail' => [
'class' => Plugi\Core\Mailer::class,
'transport' => 'smtp',
'host' => '',
'port' => 587,
'encryption' => 'tls',
'username' => '',
'password' => '',
'from_address' => '',
'from_name' => '',
'timeout' => 10,
'host' => $_ENV['MAIL_HOST'] ?? '',
'port' => (int) ($_ENV['MAIL_PORT'] ?? 587),
'encryption' => $_ENV['MAIL_ENCRYPTION'] ?? 'tls',
'username' => $_ENV['MAIL_USERNAME'] ?? '',
'password' => $_ENV['MAIL_PASSWORD'] ?? '',
'from_address' => $_ENV['MAIL_FROM_ADDRESS'] ?? '',
'from_name' => $_ENV['MAIL_FROM_NAME'] ?? '',
'timeout' => (int) ($_ENV['MAIL_TIMEOUT'] ?? 10),
],
/*
+28 -7
View File
@@ -1,3 +1,4 @@
# Development only. Do not use this Compose stack for production deployments.
services:
web:
build: .
@@ -7,7 +8,28 @@ services:
depends_on:
- mysql
ports:
- '63000:80'
- '127.0.0.1:63000:80'
environment:
STAGE: ${STAGE:-production}
BASE_URL: ${BASE_URL:-http://localhost:63000}
DATABASE_DRIVER: ${DATABASE_DRIVER:-mysql}
DATABASE_HOST: ${DATABASE_HOST:-mysql}
DATABASE_DATABASE: ${DATABASE_DATABASE:-plugi}
DATABASE_USERNAME: ${DATABASE_USERNAME:-plugi}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-change-me}
DATABASE_CHARSET: ${DATABASE_CHARSET:-utf8mb4}
DATABASE_PREFIX: ${DATABASE_PREFIX:-}
USERNAME: ${USERNAME:-admin}
PASSWORD: ${PASSWORD:-}
PASSWORD_HASH: ${PASSWORD_HASH:-}
MAIL_HOST: ${MAIL_HOST:-}
MAIL_PORT: ${MAIL_PORT:-587}
MAIL_ENCRYPTION: ${MAIL_ENCRYPTION:-tls}
MAIL_USERNAME: ${MAIL_USERNAME:-}
MAIL_PASSWORD: ${MAIL_PASSWORD:-}
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS:-}
MAIL_FROM_NAME: ${MAIL_FROM_NAME:-}
MAIL_TIMEOUT: ${MAIL_TIMEOUT:-10}
links:
- mysql
networks:
@@ -15,7 +37,7 @@ services:
adminer:
image: adminer
ports:
- 63001:8080
- '127.0.0.1:63001:8080'
links:
- mysql
networks:
@@ -24,13 +46,12 @@ services:
image: "mysql:8.0"
restart: 'always'
volumes:
- '.:/application'
- db:/var/lib/mysql:cached
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=plugi
- MYSQL_USER=plugi
- MYSQL_PASSWORD=plugi
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-me-root}
MYSQL_DATABASE: ${DATABASE_DATABASE:-plugi}
MYSQL_USER: ${DATABASE_USERNAME:-plugi}
MYSQL_PASSWORD: ${DATABASE_PASSWORD:-change-me}
# ports:
# - '63002:3306'
networks:
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
require_once __DIR__.'/plugi-core/src/Core/EnvLoader.php';
(new Plugi\Core\EnvLoader())->load();
(new Plugi\Core\EnvLoader(__DIR__ . '/.env'))->load();
if ($_ENV['STAGE'] !== 'production') {
ini_set('display_errors', 1);