docker-lychee/Dockerfile
2023-05-27 17:23:20 -05:00

69 lines
2.0 KiB
Docker

# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.18
# set version label
ARG BUILD_DATE
ARG VERSION
ARG LYCHEE_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="hackerman"
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
exiftool \
ffmpeg \
gd \
imagemagick \
jpegoptim \
php82-bcmath \
php82-dom \
php82-exif \
php82-gd \
php82-intl \
php82-mysqli \
php82-pdo_mysql \
php82-pdo_pgsql \
php82-pdo_sqlite \
php82-pecl-imagick \
php82-pecl-redis \
php82-pgsql \
php82-sqlite3 \
php82-tokenizer && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
echo "**** install lychee ****" && \
if [ -z "${LYCHEE_VERSION}" ]; then \
LYCHEE_VERSION=$(curl -sX GET "https://api.github.com/repos/LycheeOrg/Lychee/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
mkdir -p /app/www && \
git clone --branch "${LYCHEE_VERSION}" --recurse-submodules https://github.com/LycheeOrg/Lychee.git /app/www && \
echo "**** install composer dependencies ****" && \
composer install \
-d /app/www \
--no-interaction \
--no-dev \
--prefer-dist && \
echo "**** remove bloat ****" && \
find . -wholename '*/[Tt]ests/*' -delete && \
find . -wholename '*/[Tt]est/*' -delete && \
rm -rf /app/www/storage/framework/cache/data/* && \
rm -rf /app/www/storage/framework/sessions/* && \
rm -rf /app/www/storage/framework/views/* && \
rm -rf /app/www/storage/logs/* && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
$HOME/.cache \
$HOME/.composer
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config