Compare commits

...

16 commits

5 changed files with 134 additions and 35 deletions

View file

@ -24,7 +24,7 @@ jobs:
contents: read contents: read
outputs: outputs:
version: ${{ steps.dotclear.outputs.version }} version: ${{ steps.dotclear.outputs.version }}
exists: ${{ steps.repository.outputs.release-exists }} exists: ${{ steps.repository.outputs.exists }}
steps: steps:
- name: Install required packages - name: Install required packages
run: curl -sSL https://bit.ly/install-xq | sudo bash run: curl -sSL https://bit.ly/install-xq | sudo bash
@ -42,9 +42,9 @@ jobs:
- name: Check repository releases - name: Check repository releases
id: repository id: repository
uses: insightsengineering/release-existence-action@v1.0.0 uses: mukunku/tag-exists-action@v1.6.0
with: with:
release-tag: ${{ steps.dotclear.outputs.version }} tag: ${{ steps.dotclear.outputs.version }}
do_release: do_release:
name: Create repository release according to Dotclear version name: Create repository release according to Dotclear version
@ -54,12 +54,16 @@ jobs:
needs: check_release needs: check_release
if: needs.check_release.outputs.exists == 'false' if: needs.check_release.outputs.exists == 'false'
steps: steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create repository release - name: Create repository release
id: create_release id: create_release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
tag_name: ${{ needs.check_release.outputs.version }}
name: ${{ needs.check_release.outputs.version }} name: ${{ needs.check_release.outputs.version }}
tag_name: ${{ needs.check_release.outputs.version }}
draft: false draft: false
prerelease: false prerelease: false

View file

@ -52,7 +52,7 @@ COPY etc/snippets_common.conf /etc/nginx/snippets/snippets_common.conf
# Try to bypass Alpine Linux iconv bug # Try to bypass Alpine Linux iconv bug
#RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ gnu-libiconv #RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ gnu-libiconv
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.12/community/ gnu-libiconv=1.15-r2 RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.12/community/ gnu-libiconv=1.15-r2
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
# Use PHP 8.3 release # Use PHP 8.3 release
ENV VER_PHP=php83 ENV VER_PHP=php83
@ -115,6 +115,27 @@ ENV DC_TPL_CACHE=/var/www/dotclear/cache
# Directory for dotclear var # Directory for dotclear var
ENV DC_VAR=/var/www/dotclear/var ENV DC_VAR=/var/www/dotclear/var
##
# Plugins
##
# DotclearWatch
ENV VER_DW=0.9.3
RUN curl -fsSL -o plugin.zip "https://github.com/JcDenis/DotclearWatch/releases/download/v$VER_DW/plugin-DotclearWatch.zip" \
&& mkdir -p /var/lib/dotclear/plugins/DotclearWatch \
&& unzip -d /var/lib/dotclear/plugins plugin.zip \
&& chown -R www:www /var/lib/dotclear/plugins \
&& rm plugin.zip
# sysInfo
ENV VER_SI=9.6
RUN curl -fsSL -o plugin.zip "https://github.com/franck-paul/sysInfo/releases/download/$VER_SI/plugin-sysInfo-$VER_SI.zip" \
&& mkdir -p /var/lib/dotclear/plugins/sysInfo \
&& unzip -d /var/lib/dotclear/plugins plugin.zip \
&& chown -R www:www /var/lib/dotclear/plugins \
&& rm plugin.zip
## ##
# END # END
## ##

110
README.md
View file

@ -8,13 +8,15 @@
![Testing image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_testing.yml/badge.svg) ![Testing image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_testing.yml/badge.svg)
![Unstable image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_unstable.yml/badge.svg) ![Unstable image build](https://github.com/JcDenis/docker-dotclear/actions/workflows/release_unstable.yml/badge.svg)
## THE SHORT WAY
## 1. THE SHORT WAY
In your futur server, with Docker compose installed, execute: 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 curl -fsSL -o docker-compose.yaml https://raw.githubusercontent.com/JcDenis/docker-dotclear/refs/heads/master/docker-compose.yaml && docker-compose up -d
## WHAT IS DOTCLEAR
## 2. WHAT IS DOTCLEAR
Dotclear is an open-source web publishing software. Dotclear is an open-source web publishing software.
Take control over your blog! Take control over your blog!
@ -24,25 +26,28 @@ tool allowing anyone to publish on the web, regardless of their technical skills
=> https://dotclear.org/ => https://dotclear.org/
## WHAT IS DOCKER-DOTCLEAR
## 3. WHAT IS DOCKER-DOTCLEAR
This repository contains all features to build or run Dotclear on a Docker environment. This repository contains all features to build or run Dotclear on a Docker environment.
It is hightly based on work from [darknao](https://github.com/darknao/docker-dotclear). It is hightly based on work from [darknao](https://github.com/darknao/docker-dotclear).
* Dotclear docker images are avaialable at [Docker hub](https://hub.docker.com/r/jcpd/docker-dotclear) or [Github registry](https://github.com/JcDenis?tab=packages&repo_name=docker-dotclear) * 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)
* Dotclear docker sources are avaialable at [Github repository](https://github.com/JcDenis/docker-dotclear) * Dotclear docker sources are avaialable at [Github repository](https://github.com/JcDenis/docker-dotclear)
### TAGS
Docker image tag is based on __Alpine Linux OS, Nginx server and PHP-FPM language__. ### 3.1 TAGS
It is composed of Dotclear version or release type:
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) * x.x : A given Dotclear version (ex: 2.31.1)
* latest : The latest stable Dotclear release * latest : The latest stable Dotclear release
* testing: The latest dev of Dotclear stable branch * testing: The latest dev of Dotclear stable branch
* dev : A Dotclear unstable (nightly) release * dev : A Dotclear unstable (nightly) release
### BUILDS
### 3.2 BUILDS
Clone this repository: Clone this repository:
@ -66,9 +71,13 @@ Builds should support:
* linux/386,linux/amd64,linux/arm64,linux/arm/V7 plateforms * linux/386,linux/amd64,linux/arm64,linux/arm/V7 plateforms
* docker container healthcheck * docker container healthcheck
### DOCKER
**Exemple of a docker compose file with a mariadb database:** ### 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: services:
# MYSQL database service # MYSQL database service
@ -128,7 +137,10 @@ On first run Dotclear does its installation process and ask you to create a firs
On first run you should wait that container download and install required version of Dotclear, On first run you should wait that container download and install required version of Dotclear,
this may takes a while... this may takes a while...
**Another exemple with an SQLite database and a single container:**
#### 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: services:
dotclear: dotclear:
@ -144,15 +156,24 @@ this may takes a while...
DC_DBNAME: \var\www\dotclear\sqlite.db DC_DBNAME: \var\www\dotclear\sqlite.db
DC_ADMINMAILFROM: contact@exemple.com DC_ADMINMAILFROM: contact@exemple.com
or with a simple docker command: 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 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 SQLite database will be stored in folder \var\www\dotclear
### BLOG
__Standard configuration by subfolders__ ### 3.4 BLOG
#### 3.4.1 Standard configuration by subfolders
These images use Dotclear URL rewriting in PATH INFO mode. These images use Dotclear URL rewriting in PATH INFO mode.
By default URL and path should be corrected by a custom plugin automatically. By default URL and path should be corrected by a custom plugin automatically.
@ -167,7 +188,22 @@ Blogs administration is available at http://localhost/admin
When you create a new blog in this configuration, 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/ you must use the _blog_id_ with the trailing slash in blog URL setting like http://localhost/blog_id/
__Standard configuration by subdomains__ __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. These images use Dotclear URL rewriting in PATH INFO mode.
By default URL and path should be corrected by a custom plugin automatically. By default URL and path should be corrected by a custom plugin automatically.
@ -182,7 +218,28 @@ Blogs administration is available at http://xxx.domain.tld/admin
When you create a new blog in this configuration, 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/ you must use the _blog_id_ as subdomain in blog URL setting like http://blog_id.domain.tld/
__Non standard configuration__ __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): Setup nginx server configuration (see bellow):
@ -204,7 +261,8 @@ Then fix public_path and public_url for the blog:
* set _public_path_ to the real path on system to public directory of the blog * 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 * set _public_url_ to the URL of the public directory of the blog
### STRUCTURE
### 3.5 STRUCTURE
Default root path of this image structure is in __/var/www/dotclear__ with sub folders: Default root path of this image structure is in __/var/www/dotclear__ with sub folders:
@ -216,23 +274,29 @@ Default root path of this image structure is in __/var/www/dotclear__ with sub f
* _themes_ : Dotclear themes directory * _themes_ : Dotclear themes directory
* _var_ : Dotclear var directory * _var_ : Dotclear var directory
### UPGRADE
To upgrade Dotclear to next version, ### 3.6 UPGRADE
it is recommanded to pull latest image and restart the docker container
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. or use Dotclear buitin update system but themes wiil not be updated.
### TODO
### 4. TODO
* Add better cache management. From another container or from Dotclear container. * Add better cache management. From another container or from Dotclear container.
* Add mail support. * Add mail support.
### CONTRIBUTING
### 5. CONTRIBUTING
This image is an open source project. If you'd like to contribute, please read the [CONTRIBUTING file](/CONTRIBUTING.md). 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. You can submit a pull request, or feel free to use any other way you'd prefer.
### LICENSE
### 6. LICENSE
Copyright Jean-Christian Paul Denis Copyright Jean-Christian Paul Denis
AGPL-v3 <https://www.gnu.org/licenses/agpl-3.0.html> AGPL-v3 <https://www.gnu.org/licenses/agpl-3.0.html>

View file

@ -16,12 +16,24 @@ fi
export COMPARE_IMAGE=$(sed -n "${COMPARE_HAYSTACK}" /usr/src/dotclear/release.json) export COMPARE_IMAGE=$(sed -n "${COMPARE_HAYSTACK}" /usr/src/dotclear/release.json)
export VERSION_IMAGE=$(sed -n "s/^\s*\"release_version\":\s*\"\(.*\)\",/\1/p" /usr/src/dotclear/release.json) export VERSION_IMAGE=$(sed -n "s/^\s*\"release_version\":\s*\"\(.*\)\",/\1/p" /usr/src/dotclear/release.json)
# Simple versions comparison function that works with Dotclear stable versioning # Simple versions comparison function that fits all releases
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } function version { echo "$@" | awk -F. '{ printf("%d%04d%03d\n", $1,$2,$3); }'; }
# Update Docker structure # Update Docker structure
echo >&2 "Updating Docker structure..." echo >&2 "Updating Docker structure..."
cp -Ru /var/lib/dotclear /var/www mkdir -p /var/www/dotclear/app \
/var/www/dotclear/blogs \
/var/www/dotclear/blogs/default \
/var/www/dotclear/cache \
/var/www/dotclear/plugins \
/var/www/dotclear/servers \
/var/www/dotclear/themes \
/var/www/dotclear/var
# Always replace image plugins
cp -rf /var/lib/dotclear/plugins/* /var/www/dotclear/plugins
# Copy nginx server conf only if not exists
cp -n /var/lib/dotclear/servers/subdomain.conf /var/www/dotclear/servers/
cp -n /var/lib/dotclear/servers/subfolder.conf /var/www/dotclear/servers/
# Check if Dotclear is already on system # Check if Dotclear is already on system
if ! [ -e index.php -a -e src/App.php ]; then if ! [ -e index.php -a -e src/App.php ]; then
@ -50,7 +62,7 @@ fi
# Update Docker structure # Update Docker structure
echo >&2 "Updating Dotclear common themes..." echo >&2 "Updating Dotclear common themes..."
cp -Ru /var/www/dotclear/app/themes/* /var/www/dotclear/themes cp -rf /var/www/dotclear/app/themes/* /var/www/dotclear/themes
# DEBUG mode for non stable releases # DEBUG mode for non stable releases
if [ "$CNL_DOTCLEAR" == "stable" ]; then if [ "$CNL_DOTCLEAR" == "stable" ]; then

View file

@ -1,2 +0,0 @@
<?php
header('Location: /default');