Support running RO

This commit is contained in:
thespad 2024-12-17 16:28:41 +00:00
parent 7446ab18b6
commit 184e47862f
No known key found for this signature in database
6 changed files with 22 additions and 22 deletions

View File

@ -12,7 +12,6 @@ LABEL maintainer="chbmb"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
# libxml2 \
php83-dom \
php83-gd \
php83-intl \
@ -47,6 +46,10 @@ RUN \
/usr/bin/kepubify -L \
"https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit" && \
chmod 755 /usr/bin/kepubify && \
mkdir -p /defaults/config && \
cp /app/www/public/config/* /defaults/config && \
rm -rf /app/www/public/config && \
ln -s /config/config /app/www/public/config && \
echo "**** cleanup ****" && \
rm -rf \
/root/.composer \

View File

@ -12,7 +12,6 @@ LABEL maintainer="chbmb"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
# libxml2 \
php83-dom \
php83-gd \
php83-intl \
@ -35,7 +34,6 @@ RUN \
tar xf /tmp/cops.tar.gz -C \
/app/www/public --strip-components=1 && \
cd /app/www/public && \
# use standard composer 2.x now, no need to install older 1.x version
composer \
install --no-dev --optimize-autoloader && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
@ -48,6 +46,10 @@ RUN \
/usr/bin/kepubify -L \
"https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-arm64" && \
chmod 755 /usr/bin/kepubify && \
mkdir -p /defaults/config && \
cp /app/www/public/config/* /defaults/config && \
rm -rf /app/www/public/config && \
ln -s /config/config /app/www/public/config && \
echo "**** cleanup ****" && \
rm -rf \
/root/.composer \

View File

@ -94,6 +94,14 @@ Access the webui at `http://<docker host ip>:80`. For connecting via OPDS on a m
The linuxserver version gives you access to `config/local.php` in `/config` to customise your install to suit your needs, it also includes the dependencies required to directly view epub books in your browser.
## Read-Only Operation
This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/).
### Caveats
* `/tmp` must be mounted to tmpfs
## Usage
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
@ -151,6 +159,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-v /config` | COPS Application Data. |
| `-v /books` | Calibre metadata.db location. |
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
## Environment variables from files (Docker secrets)

View File

@ -53,6 +53,9 @@ param_usage_include_ports: true
param_ports:
- {external_port: "80", internal_port: "80", port_desc: "HTTP WebUI"}
- {external_port: "443", internal_port: "443", port_desc: "HTTPS WebUI"}
readonly_supported: true
readonly_message: |
* `/tmp` must be mounted to tmpfs
# application setup block
app_setup_block_enabled: true
app_setup_block: |

View File

@ -8,19 +8,6 @@ mkdir -p \
mkdir -p \
/config/config
# clear previous config (COPS 1.x and 2.x)
for f in /app/www/public/config_local.*.php; do
if [ -f "$f" ]; then
rm "$f"
fi
done
# clear previous config (COPS 3.x)
for f in /app/www/public/config/local.*.php; do
if [ -f "$f" ]; then
rm "$f"
fi
done
# copy config
if [[ ! -e /config/config/local.php ]]; then
if [[ -e /config/config_local.php ]]; then
@ -28,15 +15,11 @@ if [[ ! -e /config/config/local.php ]]; then
cp /config/config_local.php /config/config/local.php
else
echo "**** New instance detected, generating default config at /config/config/local.php ****"
cp /defaults/config/local.php /config/config/local.php
cp /defaults/local/local.php /config/config/
fi
fi
# copy extra user-profiles
for f in /config/config/local*.php; do
cp "${f}" /app/www/public/config/
chmod +r "/app/www/public/config/$(basename ${f})"
done
cp /defaults/config/* /config/config/
# permissions
lsiown -R abc:abc \