Dotclear on Docker environment https://docker.dotclear.watch
Find a file
2024-12-10 00:37:24 +01:00
.github freeze testing to latest stable branch 2024-12-10 00:37:24 +01:00
etc add reminder for proxy remote_addr 2024-12-05 16:25:33 +01:00
exemple/compose add docker-compose.yml exemples 2024-12-06 18:39:18 +01:00
www remove unused file 2024-11-30 14:13:13 +01:00
CONTRIBUTING.md Create CONTRIBUTING.md 2024-10-30 20:00:06 +01:00
docker-compose.yaml fix line ending 2024-11-24 13:55:58 +01:00
docker-entrypoint.sh fine grain structure copy 2024-11-30 14:16:33 +01:00
Dockerfile bump sysInfo 9.8 2024-12-07 10:13:14 +01:00
LICENSE restart from only one server type 2024-11-11 17:56:16 +01:00
README.md use docker repo as badge 2024-12-04 18:42:29 +01:00
SECURITY.md fix line ending 2024-11-24 13:55:58 +01:00

README

Stable image version Docker image size Stable image downloads

Stable image build Testing image build Unstable image build

1. THE SHORT WAY

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

2. WHAT IS DOTCLEAR

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.

=> https://dotclear.org/

3. WHAT IS DOCKER-DOTCLEAR

This repository contains all features to build or run Dotclear on a Docker environment. It is hightly based on work from darknao.

3.1 TAGS

Docker images are based on Alpine Linux OS, Nginx server and PHP-FPM language. Image tags are composed of Dotclear version or release type:

  • x.x : A given Dotclear version (ex: 2.31.1)
  • latest : The latest stable Dotclear release
  • testing: The latest dev of Dotclear stable branch
  • dev : A Dotclear unstable (nightly) release

3.2 BUILDS

Clone this repository:

git clone https://github.com/JcDenis/docker-dotclear.git

To build image from stable canal, from the Dokerfile path, execute:

docker build -t dotclear:latest --build-arg CANAL=stable .

Or to build image from testing canal, from the Dokerfile path, execute:

docker build -t dotclear:testing --build-arg CANAL=testing .

Or to build image from unstable canal, from the Dokerfile path, execute:

docker build -t dotclear:dev --build-arg CANAL=unstable .

Builds should support:

  • postgresql and mysql and sqlite database
  • linux/386,linux/amd64,linux/arm64,linux/arm/V7 plateforms
  • docker container healthcheck

3.3 DOCKER

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 :

services:
  # MYSQL database service
  dc_db:
    image: mariadb:latest
    container_name: dotcleardb
    restart: unless-stopped
    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
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      start_period: 10s
      interval: 10s
      timeout: 5s
      retries: 3

  # PHP-FPM Service
  dc_app:
    image: jcpd/docker-dotclear:latest
    container_name: dotclearphp
    restart: unless-stopped
    volumes:
      - dc_app:/var/www/dotclear
    ports:
      - 80:80
    depends_on:
      dc_db: # MYSQL database service
        condition: service_healthy # Waiting for database ready
    environment:
      # 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

volumes:
  dc_app: # NGINX (dotclear) volume
  dc_db: # MYSQL (database) volume
  • You MUST replace database USER and PASSWORD by something else.

Then execute:

docker-compose up -d

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...

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 :

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

Then execute:

docker-compose up -d

3.3.3 Direct docker run without docker compose

Exemple with a simple docker command :

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

SQLite database will be stored in folder \var\www\dotclear

3.4 BLOG

3.4.1 Standard configuration by subfolders

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:

Blogs administration is available at http://localhost/admin

When you create a new blog in this configuration, you must use the blog_id with the trailing slash in blog URL setting like http://localhost/blog_id/

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

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:

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/

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

Setup nginx server configuration (see bellow):

  • adapt /var/www/dotclear/servers/*.conf to your needs

Then to configure blog:

Then fix public_path and public_url for the blog:

  • 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

3.5 STRUCTURE

Default root path of this image structure is in /var/www/dotclear with sub folders:

  • app : Dotclear application files
  • blogs : Blogs public directories
  • cache : Dotclear template cache
  • plugins : Third party plugins directory
  • servers : Nginx servers configurations
  • themes : Dotclear themes directory
  • var : Dotclear var directory

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

or use Dotclear buitin update system but themes wiil not be updated.

4. TODO

  • Add better cache management. From another container or from Dotclear container.
  • Add mail support.

5. CONTRIBUTING

This image is an open source project. If you'd like to contribute, please read the CONTRIBUTING file. You can submit a pull request, or feel free to use any other way you'd prefer.

6. LICENSE

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