Compare commits

..

No commits in common. "ef972f891a79964c20f58d883dd769baa1501dbf" and "3dc108f65b5779187e7ca1c02b35954649f7285e" have entirely different histories.

5 changed files with 35 additions and 134 deletions

View file

@ -24,7 +24,7 @@ jobs:
contents: read
outputs:
version: ${{ steps.dotclear.outputs.version }}
exists: ${{ steps.repository.outputs.exists }}
exists: ${{ steps.repository.outputs.release-exists }}
steps:
- name: Install required packages
run: curl -sSL https://bit.ly/install-xq | sudo bash
@ -42,9 +42,9 @@ jobs:
- name: Check repository releases
id: repository
uses: mukunku/tag-exists-action@v1.6.0
uses: insightsengineering/release-existence-action@v1.0.0
with:
tag: ${{ steps.dotclear.outputs.version }}
release-tag: ${{ steps.dotclear.outputs.version }}
do_release:
name: Create repository release according to Dotclear version
@ -54,16 +54,12 @@ jobs:
needs: check_release
if: needs.check_release.outputs.exists == 'false'
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create repository release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.check_release.outputs.version }}
tag_name: ${{ needs.check_release.outputs.version }}
name: ${{ needs.check_release.outputs.version }}
draft: 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
#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
ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
# Use PHP 8.3 release
ENV VER_PHP=php83
@ -115,27 +115,6 @@ ENV DC_TPL_CACHE=/var/www/dotclear/cache
# Directory for 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
##

110
README.md
View file

@ -8,15 +8,13 @@
![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)
## 1. THE SHORT WAY
## 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
## WHAT IS DOTCLEAR
Dotclear is an open-source web publishing software.
Take control over your blog!
@ -26,28 +24,25 @@ tool allowing anyone to publish on the web, regardless of their technical skills
=> https://dotclear.org/
## 3. WHAT IS DOCKER-DOTCLEAR
## 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](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/docker-dotclear/pkgs/container/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 sources are avaialable at [Github repository](https://github.com/JcDenis/docker-dotclear)
### TAGS
### 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:
Docker image tag is based on __Alpine Linux OS, Nginx server and PHP-FPM language__.
It is 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
### BUILDS
Clone this repository:
@ -71,13 +66,9 @@ Builds should support:
* linux/386,linux/amd64,linux/arm64,linux/arm/V7 plateforms
* docker container healthcheck
### DOCKER
### 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 :
**Exemple of a docker compose file with a mariadb database:**
services:
# MYSQL database service
@ -137,10 +128,7 @@ 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,
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 :
**Another exemple with an SQLite database and a single container:**
services:
dotclear:
@ -156,24 +144,15 @@ Create and edit a **docker-compose.yaml** file and put into it this contents :
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 :
or 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
### BLOG
### 3.4 BLOG
#### 3.4.1 Standard configuration by subfolders
__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.
@ -188,22 +167,7 @@ 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
__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.
@ -218,28 +182,7 @@ 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
__Non standard configuration__
Setup nginx server configuration (see bellow):
@ -261,8 +204,7 @@ 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_url_ to the URL of the public directory of the blog
### 3.5 STRUCTURE
### STRUCTURE
Default root path of this image structure is in __/var/www/dotclear__ with sub folders:
@ -274,29 +216,23 @@ Default root path of this image structure is in __/var/www/dotclear__ with sub f
* _themes_ : Dotclear themes directory
* _var_ : Dotclear var directory
### UPGRADE
### 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
To upgrade Dotclear to next version,
it is recommanded to pull latest image and restart the docker container
or use Dotclear buitin update system but themes wiil not be updated.
### 4. TODO
### TODO
* Add better cache management. From another container or from Dotclear container.
* Add mail support.
### 5. CONTRIBUTING
### CONTRIBUTING
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.
### 6. LICENSE
### LICENSE
Copyright Jean-Christian Paul Denis
AGPL-v3 <https://www.gnu.org/licenses/agpl-3.0.html>

View file

@ -16,24 +16,12 @@ fi
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)
# Simple versions comparison function that fits all releases
function version { echo "$@" | awk -F. '{ printf("%d%04d%03d\n", $1,$2,$3); }'; }
# Simple versions comparison function that works with Dotclear stable versioning
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Update Docker structure
echo >&2 "Updating Docker structure..."
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/
cp -Ru /var/lib/dotclear /var/www
# Check if Dotclear is already on system
if ! [ -e index.php -a -e src/App.php ]; then
@ -62,7 +50,7 @@ fi
# Update Docker structure
echo >&2 "Updating Dotclear common themes..."
cp -rf /var/www/dotclear/app/themes/* /var/www/dotclear/themes
cp -Ru /var/www/dotclear/app/themes/* /var/www/dotclear/themes
# DEBUG mode for non stable releases
if [ "$CNL_DOTCLEAR" == "stable" ]; then

2
www/blogs/index.php Normal file
View file

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