-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
88 lines (83 loc) · 2.53 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.20
# 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 build packages ****" && \
apk add --no-cache --upgrade --virtual=build-dependencies \
nodejs \
npm && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
exiftool \
ffmpeg \
gd \
grep \
imagemagick \
jpegoptim \
php83-bcmath \
php83-dom \
php83-exif \
php83-gd \
php83-intl \
php83-mysqli \
php83-pdo_mysql \
php83-pdo_pgsql \
php83-pdo_sqlite \
php83-pecl-imagick \
php83-pecl-redis \
php83-pgsql \
php83-sodium \
php83-sqlite3 \
php83-tokenizer \
postgresql15-client && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php83/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php83/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php83/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 && \
curl -o \
/tmp/lychee.tar.gz -L \
"https://github.com/LycheeOrg/Lychee/archive/${LYCHEE_VERSION}.tar.gz" && \
tar xf /tmp/lychee.tar.gz -C \
/app/www --strip-components=1 && \
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 "**** build npm dependencies ****" && \
cd /app/www && \
npm ci --no-audit && \
npm run build && \
rm -rf /app/www/node_modules && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
$HOME/.cache \
$HOME/.composer \
$HOME/.npm
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 80 443
VOLUME /config