From 83a588968750df340b9b1be4dacf2f4526d618fd Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Tue, 11 Sep 2018 00:17:41 +0100 Subject: [PATCH] some initial tidying up and rearranging --- Dockerfile | 76 ++++++++++++++++-------------------- root/etc/services.d/cron/run | 3 -- 2 files changed, 34 insertions(+), 45 deletions(-) delete mode 100644 root/etc/services.d/cron/run diff --git a/Dockerfile b/Dockerfile index 98c503c..d995d80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM lsiobase/alpine.nginx:3.7 +FROM lsiobase/alpine.nginx:3.8 # set version label ARG BUILD_DATE @@ -8,66 +8,58 @@ LABEL maintainer="alex-phillips" RUN \ echo "**** install build packages ****" && \ - apk add --no-cache \ - grep \ - logrotate \ - ncurses \ - php7 \ - php7-curl \ - php7-json \ - php7-mbstring \ - php7-openssl \ - php7-phar \ - php7-session \ - python3 && \ apk add --no-cache --virtual=build-dependencies \ - curl \ + curl \ gcc \ musl-dev \ python3-dev \ py3-pip && \ - # fix logrotate - sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \ - echo "**** symlinking python ****" && \ - ln -s /usr/bin/python3 /usr/bin/python && \ + echo "**** install runtime packages ****" && \ + apk add --no-cache \ + grep \ + ncurses \ + php7-curl \ + php7-phar \ + python3 && \ + echo "**** install composer ****" && \ + curl \ + -sS https://getcomposer.org/installer \ + | php -- --install-dir=/usr/bin --filename=composer && \ echo "**** install diskover ****" && \ mkdir -p /app/diskover && \ if [ -z ${DISKOVER_RELEASE+x} ]; then \ - DISKOVER_RELEASE=$(curl -sX GET "https://api.github.com/repos/shirosaidev/diskover/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + DISKOVER_RELEASE=$(curl -sX GET "https://api.github.com/repos/shirosaidev/diskover/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/diskover.tar.gz -L \ - "https://github.com/shirosaidev/diskover/archive/${DISKOVER_RELEASE}.tar.gz" && \ + "https://github.com/shirosaidev/diskover/archive/${DISKOVER_RELEASE}.tar.gz" && \ tar xf \ /tmp/diskover.tar.gz -C \ - /app/diskover/ --strip-components=1 && \ + /app/diskover/ --strip-components=1 && \ + echo "**** install diskover-web ****" && \ + mkdir -p /app/diskover-web && \ + if [ -z ${DISKOVER_WEB_RELEASE+x} ]; then \ + DISKOVER_WEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/shirosaidev/diskover-web/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + fi && \ + curl -o \ + /tmp/diskover-web.tar.gz -L \ + "https://github.com/shirosaidev/diskover-web/archive/${DISKOVER_WEB_RELEASE}.tar.gz" && \ + tar xf \ + /tmp/diskover-web.tar.gz -C \ + /app/diskover-web/ --strip-components=1 && \ echo "**** install pip packages ****" && \ cd /app/diskover && \ pip3 install --no-cache-dir -r requirements.txt && \ pip3 install rq-dashboard && \ - echo "**** install composer ****" && \ - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ - php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ - php composer-setup.php && \ - php -r "unlink('composer-setup.php');" && \ - mv composer.phar /usr/bin/composer && \ - /usr/bin/composer self-update && \ - echo "**** install diskover-web ****" && \ - mkdir -p /app/diskover-web && \ - if [ -z ${DISKOVER_WEB_RELEASE+x} ]; then \ - DISKOVER_WEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/shirosaidev/diskover-web/releases/latest" \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ - fi && \ - curl -o \ - /tmp/diskover-web.tar.gz -L \ - "https://github.com/shirosaidev/diskover-web/archive/${DISKOVER_WEB_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/diskover-web.tar.gz -C \ - /app/diskover-web/ --strip-components=1 && \ echo "**** install composer packages ****" && \ cd /app/diskover-web && \ - /usr/bin/composer install && \ + composer install && \ + echo "**** fix logrotate ****" && \ + sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \ + echo "**** symlink python3 ****" && \ + ln -s /usr/bin/python3 /usr/bin/python && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/root/etc/services.d/cron/run b/root/etc/services.d/cron/run deleted file mode 100644 index 29cd322..0000000 --- a/root/etc/services.d/cron/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec /usr/sbin/crond -f -S -l 5 -c /etc/crontabs