docker-dotclear/README.md

309 lines
10 KiB
Markdown
Raw Normal View History

2024-10-30 18:55:02 +00:00
# README
2024-11-16 12:50:44 +00:00
![Stable image version](https://img.shields.io/github/v/release/JcDenis/docker-dotclear)
![Docker image size](https://img.shields.io/docker/image-size/jcpd/docker-dotclear/latest)
2024-11-16 10:47:52 +00:00
![Stable image downloads](https://img.shields.io/docker/pulls/jcpd/docker-dotclear)
![Stable image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_stable.yml/badge.svg)
2024-11-16 12:55:28 +00:00
![Testing image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_testing.yml/badge.svg)
2024-11-16 10:47:52 +00:00
![Unstable image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_unstable.yml/badge.svg)
2024-11-16 08:21:29 +00:00
2024-11-25 20:16:19 +00:00
## 1. THE SHORT WAY
2024-11-16 08:21:29 +00:00
In your futur server, with Docker compose installed, execute:
curl -fsSL -o docker-compose.yaml https://raw.githubusercontent.com/JcDenis/docker-dotclear/refs/heads/master/docker-compose.yaml && docker-compose up -d
2024-11-25 20:16:19 +00:00
## 2. WHAT IS DOTCLEAR
2024-10-30 18:55:02 +00:00
Dotclear is an open-source web publishing software.
Take control over your blog!
Dotclear project's purpose is to provide a user-friendly
tool allowing anyone to publish on the web, regardless of their technical skills.
2024-10-31 17:26:51 +00:00
=> https://dotclear.org/
2024-11-25 20:16:19 +00:00
## 3. WHAT IS DOCKER-DOTCLEAR
2024-10-30 18:55:02 +00:00
This repository contains all features to build or run Dotclear on a Docker environment.
2024-10-31 17:26:51 +00:00
It is hightly based on work from [darknao](https://github.com/darknao/docker-dotclear).
2024-11-30 11:10:17 +00:00
* Dotclear docker images are avaialable at [Docker hub](https://hub.docker.com/r/jcpd/docker-dotclear) or [Github registry](https://github.com/JcDenis/docker-dotclear/pkgs/container/docker-dotclear)
2024-10-31 20:47:23 +00:00
* Dotclear docker sources are avaialable at [Github repository](https://github.com/JcDenis/docker-dotclear)
2024-10-31 17:26:51 +00:00
2024-11-25 20:16:19 +00:00
### 3.1 TAGS
2024-10-31 17:26:51 +00:00
2024-11-30 11:10:17 +00:00
Docker images are based on __Alpine Linux OS, Nginx server and PHP-FPM language__.
Image tags are composed of Dotclear version or release type:
2024-11-11 16:56:16 +00:00
* x.x : A given Dotclear version (ex: 2.31.1)
* latest : The latest stable Dotclear release
2024-11-16 12:55:28 +00:00
* testing: The latest dev of Dotclear stable branch
2024-11-11 16:56:16 +00:00
* dev : A Dotclear unstable (nightly) release
2024-11-25 20:16:19 +00:00
### 3.2 BUILDS
2024-11-23 17:28:31 +00:00
Clone this repository:
git clone https://github.com/JcDenis/docker-dotclear.git
2024-11-13 10:53:25 +00:00
To build image from stable canal, from the Dokerfile path, execute:
2024-11-11 16:56:16 +00:00
docker build -t dotclear:latest --build-arg CANAL=stable .
2024-11-16 12:55:28 +00:00
Or to build image from testing canal, from the Dokerfile path, execute:
docker build -t dotclear:testing --build-arg CANAL=testing .
2024-11-13 10:53:25 +00:00
Or to build image from unstable canal, from the Dokerfile path, execute:
2024-10-31 17:26:51 +00:00
2024-11-11 16:56:16 +00:00
docker build -t dotclear:dev --build-arg CANAL=unstable .
2024-11-13 10:53:25 +00:00
Builds should support:
2024-11-23 17:28:31 +00:00
* postgresql and mysql and sqlite database
2024-11-24 08:47:32 +00:00
* linux/386,linux/amd64,linux/arm64,linux/arm/V7 plateforms
2024-11-23 17:28:31 +00:00
* docker container healthcheck
2024-10-31 17:26:51 +00:00
2024-11-25 20:16:19 +00:00
### 3.3 DOCKER
2024-11-02 13:47:50 +00:00
2024-11-29 17:10:50 +00:00
#### 3.3.1 Exemple of a docker compose file with a mariadb database
Create and edit a **docker-compose.yaml** file and put into it this contents :
2024-10-31 17:26:51 +00:00
services:
# MYSQL database service
dc_db:
image: mariadb:latest
container_name: dotcleardb
2024-11-11 16:56:16 +00:00
restart: unless-stopped
2024-10-31 17:26:51 +00:00
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- dc_db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: dotclear_root
MYSQL_DATABASE: dotclear_db
MYSQL_USER: dotclear_user
MYSQL_PASSWORD: dotclear_pwd
2024-11-23 17:28:31 +00:00
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
2024-10-31 17:26:51 +00:00
# PHP-FPM Service
dc_app:
image: jcpd/docker-dotclear:latest
container_name: dotclearphp
2024-11-11 16:56:16 +00:00
restart: unless-stopped
2024-10-31 17:26:51 +00:00
volumes:
2024-11-11 16:56:16 +00:00
- dc_app:/var/www/dotclear
2024-10-31 17:26:51 +00:00
ports:
2024-11-11 16:56:16 +00:00
- 80:80
2024-10-31 17:26:51 +00:00
depends_on:
2024-11-23 17:28:31 +00:00
dc_db: # MYSQL database service
condition: service_healthy # Waiting for database ready
environment:
2024-11-11 16:56:16 +00:00
# These variables are only used for first install, see inc/config.php
DC_DBDRIVER: mysqlimb4 # MYSQL full UTF-8
DC_DBHOST: dc_db # MYSQL database service
DC_DBNAME: dotclear_db # MYSQL_DATABASE
DC_DBUSER: dotclear_user # MYSQL_USER
DC_DBPASSWORD: dotclear_pwd # MYSQL_PASSWORD
DC_DBPREFIX: dc_ # Database tables prefix
DC_ADMINMAILFROM: contact@exemple.com # Dotclear mail from
2024-10-31 17:26:51 +00:00
volumes:
2024-11-11 16:56:16 +00:00
dc_app: # NGINX (dotclear) volume
dc_db: # MYSQL (database) volume
2024-10-31 17:26:51 +00:00
2024-11-11 16:56:16 +00:00
* You __MUST__ replace database USER and PASSWORD by something else.
2024-10-31 17:26:51 +00:00
2024-11-13 10:53:25 +00:00
Then execute:
2024-10-31 17:26:51 +00:00
2024-10-31 20:47:23 +00:00
docker-compose up -d
2024-10-31 17:26:51 +00:00
2024-11-11 16:56:16 +00:00
Dotclear is now available on your server host at http://locahost/
On first run Dotclear does its installation process and ask you to create a first user.
On first run you should wait that container download and install required version of Dotclear,
this may takes a while...
2024-10-30 18:55:02 +00:00
2024-11-29 17:10:50 +00:00
#### 3.3.2 Exemple of a docker compose file with an SQLite database and a single container
Create and edit a **docker-compose.yaml** file and put into it this contents :
2024-11-16 15:29:17 +00:00
services:
dotclear:
image: jcpd/docker-dotclear:latest
container_name: dotclear
restart: unless-stopped
volumes:
- ./dotclear:/var/www/dotclear
ports:
- 80:80
environment:
DC_DBDRIVER: sqlite
DC_DBNAME: \var\www\dotclear\sqlite.db
DC_ADMINMAILFROM: contact@exemple.com
2024-11-29 17:10:50 +00:00
Then execute:
docker-compose up -d
#### 3.3.3 Direct docker run without docker compose
Exemple with a simple docker command :
2024-11-16 15:51:17 +00:00
docker run -d --name dotclear -p 80:80 -v dotclear:/var/www/dotclear -e DC_DBDRIVER=sqlite -e DC_DBNAME=/var/www/dotclear/sqlite.db -e DC_ADMINMAILFROM=contact@exemple.com jcpd/docker-dotclear:latest
2024-11-16 15:29:17 +00:00
SQLite database will be stored in folder \var\www\dotclear
2024-10-31 17:31:00 +00:00
2024-11-25 20:16:19 +00:00
### 3.4 BLOG
2024-11-29 17:10:50 +00:00
#### 3.4.1 Standard configuration by subfolders
2024-10-31 17:54:36 +00:00
2024-11-11 16:56:16 +00:00
These images use Dotclear URL rewriting in PATH INFO mode.
By default URL and path should be corrected by a custom plugin automatically.
Blogs URLs looks like:
2024-11-13 10:53:25 +00:00
2024-11-11 16:56:16 +00:00
* http://localhost/default/
* http://localhost/blog2/
* ...
2024-11-12 22:45:50 +00:00
2024-11-11 16:56:16 +00:00
Blogs administration is available at http://localhost/admin
2024-10-30 18:55:02 +00:00
2024-11-23 17:28:31 +00:00
When you create a new blog in this configuration,
2024-11-11 16:56:16 +00:00
you must use the _blog_id_ with the trailing slash in blog URL setting like http://localhost/blog_id/
2024-11-02 13:47:50 +00:00
2024-11-25 20:16:19 +00:00
__Web server configuration__
To customized web server configuration for subfolders, edit:
> /var/www/dotclear/app/servers/subfolder.conf
Original contents looks like:
server {
server_name localhost;
include /etc/nginx/snippets/snippets_subfolder.conf;
include /etc/nginx/snippets/snippets_common.conf;
}
#### 3.4.2 Standard configuration by subdomains
2024-11-23 17:28:31 +00:00
These images use Dotclear URL rewriting in PATH INFO mode.
By default URL and path should be corrected by a custom plugin automatically.
Blogs URLs looks like:
* http://default.domain.tld/
* http://blog2.domain.tld/
* ...
Blogs administration is available at http://xxx.domain.tld/admin
When you create a new blog in this configuration,
you must use the _blog_id_ as subdomain in blog URL setting like http://blog_id.domain.tld/
2024-11-25 20:16:19 +00:00
__Web server configuration__
To customized web server configuration for subdomains, edit:
> /var/www/dotclear/app/servers/subdomain.conf
Original contents looks like:
server {
server_name ~^(?<dc_blog_id>\w*?)?\.?(\w+\.\w+)$;
if ($dc_blog_id = '') {
set $dc_blog_id default;
}
if ($dc_blog_id = 'blog') {
set $dc_blog_id default;
}
include /etc/nginx/snippets/snippets_subdomain.conf;
include /etc/nginx/snippets/snippets_common.conf;
}
#### 3.4.3 Non standard configuration
2024-11-11 16:56:16 +00:00
Setup nginx server configuration (see bellow):
2024-11-23 17:28:31 +00:00
2024-11-11 16:56:16 +00:00
* adapt _/var/www/dotclear/servers/*.conf_ to your needs
2024-11-12 22:45:50 +00:00
2024-11-11 16:56:16 +00:00
Then to configure blog:
2024-11-13 10:53:25 +00:00
2024-11-11 16:56:16 +00:00
* go to the administration interface at http://my_custom_domain/admin,
2024-11-02 13:47:50 +00:00
* left side menu _Blog settings_
* panel _Advanced parameters_
2024-11-11 16:56:16 +00:00
* set _Blog URL_ to http://my_custom_domain/ (with trailing slash)
2024-11-02 13:47:50 +00:00
* set _URL scan method_ to 'PATH_INFO'
2024-11-12 22:45:50 +00:00
2024-11-11 16:56:16 +00:00
Then fix public_path and public_url for the blog:
2024-11-13 10:53:25 +00:00
2024-11-11 16:56:16 +00:00
* go to the administration interface at http://my_custom_domain/admin,
* left side menu _about:config_
* panel _system_
* set _public_path_ to the real path on system to public directory of the blog
* set _public_url_ to the URL of the public directory of the blog
2024-11-25 20:16:19 +00:00
### 3.5 STRUCTURE
2024-11-11 16:56:16 +00:00
2024-11-13 10:53:25 +00:00
Default root path of this image structure is in __/var/www/dotclear__ with sub folders:
2024-11-23 17:28:31 +00:00
* _app_ : Dotclear application files
2024-11-11 16:56:16 +00:00
* _blogs_ : Blogs public directories
* _cache_ : Dotclear template cache
* _plugins_ : Third party plugins directory
* _servers_ : Nginx servers configurations
2024-11-23 17:28:31 +00:00
* _themes_ : Dotclear themes directory
2024-11-11 16:56:16 +00:00
* _var_ : Dotclear var directory
2024-11-25 20:16:19 +00:00
### 3.6 UPGRADE
To upgrade Dotclear to next version it is recommanded to pull latest image and restart the docker container:
docker pull jcpd/docker-dotclear:latest && docker compose up -d
2024-11-23 17:28:31 +00:00
or use Dotclear buitin update system but themes wiil not be updated.
2024-11-02 13:47:50 +00:00
2024-11-25 20:16:19 +00:00
### 4. TODO
2024-10-31 17:54:36 +00:00
* Add better cache management. From another container or from Dotclear container.
2024-10-31 20:47:23 +00:00
* Add mail support.
2024-10-31 17:54:36 +00:00
2024-11-25 20:16:19 +00:00
### 5. CONTRIBUTING
2024-10-30 18:55:02 +00:00
This image is an open source project. If you'd like to contribute, please read the [CONTRIBUTING file](/CONTRIBUTING.md).
You can submit a pull request, or feel free to use any other way you'd prefer.
2024-11-25 20:16:19 +00:00
### 6. LICENSE
2024-10-30 18:55:02 +00:00
Copyright Jean-Christian Paul Denis
AGPL-v3 <https://www.gnu.org/licenses/agpl-3.0.html>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Dotclear software is licensed under AGPL-3, Copyright Olivier Meunier & Association Dotclear