Rebase to Alpine 3.16, migrate to s6v3, fix awfulness

This commit is contained in:
TheSpad 2022-11-08 22:03:06 +00:00
parent ecc450224c
commit 26f0b1228e
No known key found for this signature in database
GPG key ID: 08F06191F4587860
13 changed files with 101 additions and 72 deletions

View file

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.15
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.16
# set version label
ARG BUILD_DATE
@ -10,7 +10,6 @@ LABEL maintainer="sparklyballs"
RUN \
echo "**** install packages ****" && \
apk add --no-cache --upgrade \
curl \
exiftool \
ffmpeg \
imagemagick \
@ -43,10 +42,12 @@ RUN \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir /piwigo && \
mkdir -p /app/www/public && \
curl -o \
/piwigo/piwigo.zip -L \
/tmp/piwigo.zip -L \
"https://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}" && \
unzip -q /tmp/piwigo.zip -d /tmp && \
mv /tmp/piwigo/* /app/www/public && \
# The max filesize is 2M by default, which is way to small for most photos
sed -ri 's/^upload_max_filesize = .*/upload_max_filesize = 100M/' /etc/php8/php.ini && \
# The max post size is 8M by default, it must be at least max_filesize

View file

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.15
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.16
# set version label
ARG BUILD_DATE
@ -10,7 +10,6 @@ LABEL maintainer="sparklyballs"
RUN \
echo "**** install packages ****" && \
apk add --no-cache --upgrade \
curl \
exiftool \
ffmpeg \
imagemagick \
@ -43,10 +42,12 @@ RUN \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir /piwigo && \
mkdir -p /app/www/public && \
curl -o \
/piwigo/piwigo.zip -L \
/tmp/piwigo.zip -L \
"https://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}" && \
unzip -q /tmp/piwigo.zip -d /tmp && \
mv /tmp/piwigo/* /app/www/public && \
# The max filesize is 2M by default, which is way to small for most photos
sed -ri 's/^upload_max_filesize = .*/upload_max_filesize = 100M/' /etc/php8/php.ini && \
# The max post size is 8M by default, it must be at least max_filesize

View file

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.15
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.16
# set version label
ARG BUILD_DATE
@ -10,7 +10,6 @@ LABEL maintainer="sparklyballs"
RUN \
echo "**** install packages ****" && \
apk add --no-cache --upgrade \
curl \
exiftool \
ffmpeg \
imagemagick \
@ -40,13 +39,15 @@ RUN \
php8-pecl-xmlrpc && \
echo "**** download piwigo ****" && \
if [ -z ${PIWIGO_RELEASE+x} ]; then \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir /piwigo && \
mkdir -p /app/www/public && \
curl -o \
/piwigo/piwigo.zip -L \
/tmp/piwigo.zip -L \
"https://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}" && \
unzip -q /tmp/piwigo.zip -d /tmp && \
mv /tmp/piwigo/* /app/www/public && \
# The max filesize is 2M by default, which is way to small for most photos
sed -ri 's/^upload_max_filesize = .*/upload_max_filesize = 100M/' /etc/php8/php.ini && \
# The max post size is 8M by default, it must be at least max_filesize

View file

@ -60,12 +60,11 @@ The architectures supported by this image are:
## Application Setup
Docker image update and recreation of container alone won't update Piwigo version. In order to update Piwigo version, firstly make sure you are using the latest docker image, then go to Admin->Tools->Updates and use the app updater.
* You must create a user and database for piwigo to use in a mysql/mariadb server.
* In the setup page for database, use the ip address rather than hostname.
* A basic nginx configuration file can be found in `/config/nginx/site-confs`, edit the file to enable ssl (port 443 by default), set servername etc.
* You must create a user and database for piwigo to use in a mysql/mariadb server.
* Self-signed keys are generated the first time you run the container and can be found in `/config/keys`, if needed, you can replace them with your own.
* The easiest way to edit the configuration file is to enable local files editor from the plugins page and use it to configure email settings etc.
* The easiest way to edit the configuration file is to enable local files editor from the plugins page and use it to configure email settings etc."
## Usage
@ -85,8 +84,8 @@ services:
- PGID=1000
- TZ=Europe/London
volumes:
- </path/to/appdata/config>:/config
- </path/to/appdata/gallery>:/gallery
- /path/to/appdata/config:/config
- /path/to/appdata/gallery:/gallery
ports:
- 80:80
restart: unless-stopped
@ -101,8 +100,8 @@ docker run -d \
-e PGID=1000 \
-e TZ=Europe/London \
-p 80:80 \
-v </path/to/appdata/config>:/config \
-v </path/to/appdata/gallery>:/gallery \
-v /path/to/appdata/config:/config \
-v /path/to/appdata/gallery:/gallery \
--restart unless-stopped \
lscr.io/linuxserver/piwigo:latest
```
@ -118,7 +117,7 @@ Container images are configured using parameters passed at runtime (such as thos
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
| `-v /config` | Configuration files. |
| `-v /gallery` | Image, plugin, & theme storage for Piwigo |
| `-v /gallery` | Image storage for Piwigo |
## Environment variables from files (Docker secrets)
@ -229,6 +228,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **08.11.22:** - Rebase to Alpine 3.16, migrate to s6v3. Move application install to /app/www/public, add migration for existing users. Container updates should now update the application correctly.
* **20.08.22:** - Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base)).
* **29.06.21:** - Rebase to 3.14, Add php7-zip package
* **20.05.21:** - Create separate volume for image data

View file

@ -21,31 +21,24 @@ param_env_vars:
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." }
param_usage_include_vols: true
param_volumes:
- { vol_path: "/config", vol_host_path: "</path/to/appdata/config>", desc: "Configuration files." }
- { vol_path: "/gallery", vol_host_path: "</path/to/appdata/gallery>", desc: "Image, plugin, & theme storage for Piwigo" }
- { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Configuration files." }
- { vol_path: "/gallery", vol_host_path: "/path/to/appdata/gallery", desc: "Image storage for Piwigo" }
param_usage_include_ports: true
param_ports:
- { external_port: "80", internal_port: "80", port_desc: "Application WebUI" }
# application setup block
app_setup_block_enabled: true
app_setup_block: "Docker image update and recreation of container alone won't update Piwigo version. In order to update Piwigo version, firstly make sure you are using the latest docker image, then go to Admin->Tools->Updates and use the app updater.
app_setup_block: |
* You must create a user and database for piwigo to use in a mysql/mariadb server.
* You must create a user and database for piwigo to use in a mysql/mariadb server.
* Self-signed keys are generated the first time you run the container and can be found in `/config/keys`, if needed, you can replace them with your own.
* In the setup page for database, use the ip address rather than hostname.
* A basic nginx configuration file can be found in `/config/nginx/site-confs`, edit the file to enable ssl (port 443 by default), set servername etc.
* Self-signed keys are generated the first time you run the container and can be found in `/config/keys`, if needed, you can replace them with your own.
* The easiest way to edit the configuration file is to enable local files editor from the plugins page and use it to configure email settings etc."
app_setup_nginx_reverse_proxy_snippet: false
app_setup_nginx_reverse_proxy_block: ""
* The easiest way to edit the configuration file is to enable local files editor from the plugins page and use it to configure email settings etc."
# changelog
changelogs:
- { date: "08.11.22:", desc: "Rebase to Alpine 3.16, migrate to s6v3. Move application install to /app/www/public, add migration for existing users. Container updates should now update the application correctly." }
- { date: "20.08.22:", desc: "Rebasing to alpine 3.15 with php8. Restructure nginx configs ([see changes announcement](https://info.linuxserver.io/issues/2022-08-20-nginx-base))." }
- { date: "29.06.21:", desc: "Rebase to 3.14, Add php7-zip package" }
- { date: "20.05.21:", desc: "Create separate volume for image data" }

View file

@ -9,7 +9,7 @@ server {
server_name _;
root /config/www/gallery;
root /app/www/public;
index index.html index.htm index.php;
location / {

View file

@ -1,33 +0,0 @@
#!/usr/bin/with-contenv bash
# make our folders
mkdir -p \
/gallery
# install piwigo
if [ ! -f "/config/www/gallery/index.php" ] && [ ! -f "/gallery/index.php" ]; then
unzip -q /piwigo/piwigo.zip -d /tmp
mv /tmp/piwigo/* /gallery
rm -rf /tmp/piwigo
fi
# copy config
if [ ! -f "/config/www/gallery/local/config/config.inc.php" ] && [ ! -f "/gallery/local/config/config.inc.php" ]; then
cp /gallery/include/config_default.inc.php /gallery/local/config/config.inc.php
fi
if [ ! -d "/config/www/gallery" ]; then
ln -s /gallery /config/www/gallery
fi
if [[ -d /gallery ]]; then
if [[ "$(stat -c '%U' /gallery)" != "abc" ]]; then
chown -R abc:abc /gallery
fi
fi
# permissions
chown -R abc:abc \
/config

View file

@ -0,0 +1,64 @@
#!/usr/bin/with-contenv bash
# make our folders
mkdir -p \
/config/www/piwigo/_data \
/gallery/upload
# Migrate old data
if [[ -f /gallery/index.php ]]; then
echo "*******************************************************************************"
echo ""
echo "Migrating old install..."
mv /gallery/_data/ /config/www/piwigo/_data
mv /gallery/language/ /config/www/piwigo/language
mv /gallery/plugins/ /config/www/piwigo/plugins
mv /gallery/themes/ /config/www/piwigo/themes
mv /gallery/local/ /config/www/piwigo/local
rm /gallery/index.php
rm /config/www/gallery
sed -i "s|root /config/www/gallery;|root /app/www/public;|" /config/nginx/site-confs/default.conf
echo "Migration completed."
echo "You can now safely delete everything in /gallery *except* for the upload folder"
echo ""
echo "*******************************************************************************"
fi
rm -rf /app/www/public/upload
ln -s /gallery/upload /app/www/public/upload
rm -rf /app/www/public/_data
ln -s /config/www/piwigo/_data /app/www/public/_data
shopt -s globstar dotglob
symlinks=( \
/app/www/public/language \
/app/www/public/plugins \
/app/www/public/local \
/app/www/public/themes \
)
for i in "${symlinks[@]}"; do
if [[ -d /config/www/piwigo/"$(basename "$i")" && ! -L "$i" ]]; then
rm -rf "$i"
fi
if [[ ! -d /config/www/piwigo/"$(basename "$i")" && ! -L "$i" ]]; then
mv "$i" /config/www/piwigo/
fi
if [[ -d /config/www/piwigo/"$(basename "$i")" && ! -L "$i" ]]; then
ln -s /config/www/piwigo/"$(basename "$i")" "$i"
fi
done
shopt -u globstar dotglob
# copy config
if [[ ! -f "/config/www/piwigo/local/config/config.inc.php" ]]; then
cp /app/www/public/include/config_default.inc.php /config/www/piwigo/local/config/config.inc.php
fi
# permissions
chown -R abc:abc \
/config \
/app \
/gallery

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-piwigo-config/run