This commit is contained in:
sparklyballs 2017-01-28 10:31:44 +00:00
parent 068feeb898
commit 0ed3207e20
3 changed files with 27 additions and 19 deletions

View File

@ -7,7 +7,6 @@ ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# package version
ARG LYCHEE_VERSION="3.1.5"
ARG PHP_IMAGICK_VER="3.4.2"
# install build packages
@ -35,14 +34,19 @@ RUN \
php7-session \
php7-zip && \
# install lychee
mkdir -p \
/usr/share/webapps/lychee && \
lychee_tag=$(curl -sX GET "https://api.github.com/repos/electerious/Lychee/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -o \
/tmp/lychee.tar.gz -L \
"https://github.com/electerious/Lychee/archive/v${LYCHEE_VERSION}.tar.gz" && \
"https://github.com/electerious/Lychee/archive/${lychee_tag}.tar.gz" && \
tar xf \
/tmp/lychee.tar.gz -C \
/usr/share/webapps/lychee --strip-components=1 && \
if [ -e /usr/share/webapps/lychee/.user.ini ]; then rm /usr/share/webapps/lychee/.user.ini; fi && \
# install php imagemagick
mkdir -p \
/tmp/imagick-src && \
@ -72,4 +76,4 @@ COPY root/ /
# ports and volumes
EXPOSE 80
VOLUME /config
VOLUME /config /pictures

View File

@ -1,26 +1,30 @@
#!/usr/bin/with-contenv bash
# make symlinks
[[ ! -e /var/www/localhost/lychee ]] && \
# create our folders
mkdir -p \
/config/lychee \
/pictures/{big,import,medium,thumb}
# copy config
[[ ! -e /config/lychee/user.ini ]] && \
cp /defaults/user.ini /config/lychee/user.ini
cp /config/lychee/user.ini /usr/share/webapps/lychee/.user.ini
# create symlinks
[[ ! -L /var/www/localhost/lychee ]] && \
ln -s /usr/share/webapps/lychee /var/www/localhost/lychee
[[ ! -e /config/lychee/data ]]
mkdir -p /config/lychee && \
cp -R /usr/share/webapps/lychee/data /config/lychee && \
rm -rf /usr/share/webapps/lychee/data
[[ ! -e /config/lychee/uploads ]]
cp -R /usr/share/webapps/lychee/uploads /config/lychee && \
[[ -d /usr/share/webapps/lychee/uploads ]] && \
rm -rf /usr/share/webapps/lychee/uploads
[[ ! -e /usr/share/webapps/lychee/data ]]
ln -s /config/lychee/data /usr/share/webapps/lychee/data
[[ ! -e /usr/share/webapps/lychee/uploads ]]
ln -s /config/lychee/uploads /usr/share/webapps/lychee/uploads
[[ ! -L /usr/share/webapps/lychee/uploads ]] && \
ln -s /pictures /usr/share/webapps/lychee/uploads
[[ -d /usr/share/webapps/lychee/data ]] && \
rm -rf /usr/share/webapps/lychee/data
[[ ! -L /usr/share/webapps/lychee/data ]]
ln -s /config/lychee /usr/share/webapps/lychee/data
# permissions
chown -R abc:abc \
/config \
/pictures \
/usr/share/webapps/lychee \
/var/www/localhost/lychee