Don't include unneeded tools

This commit is contained in:
asonix 2020-01-15 09:17:47 -06:00
parent 76d9f8d95a
commit 496a183ffa
7 changed files with 44 additions and 70 deletions

View file

@ -65,18 +65,6 @@ RUN a2enmod rewrite remoteip ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
ENV TAG=v0.10.7
RUN set -ex; \
fetchDeps=git; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
\
git clone -b $TAG https://github.com/pixelfed/pixelfed /var/www/pixelfed; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
rm -rf /var/lib/apt/lists/*
RUN mkdir /scratch
WORKDIR /scratch
@ -88,25 +76,50 @@ RUN set -ex; \
test "$SIGNATURE" = "$SIG"; \
php composer-setup.php --install-dir /usr/local/bin --filename=composer
RUN apt-get update; \
apt-get install -y pngquant jpegoptim optipng tini; \
RUN rm -r /scratch
ENV TAG=v0.10.7
RUN set -ex; \
fetchDeps=git; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps
RUN chown -R www-data:root /var/www; \
find /var/www -type d -exec chmod 755 {} \;; \
find /var/www -type f -exec chmod 644 {} \;
USER www-data
RUN git clone -b $TAG https://github.com/pixelfed/pixelfed /var/www/pixelfed
USER root
RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
rm -rf /var/lib/apt/lists/*
RUN apt-get update; \
apt-get install -y pngquant jpegoptim optipng tini unzip; \
rm -rf /var/lib/apt/lists/*
COPY pixelfed /usr/local/bin/pf
COPY pixelfed-garbage /usr/local/bin/pixelfed-garbage
COPY pixelfed-startup /usr/local/bin/pixelfed-startup
COPY pixelfed-run /usr/local/bin/pixelfed-run
USER www-data
WORKDIR /var/www/pixelfed
RUN composer install --no-ansi --no-interaction --optimize-autoloader
RUN composer install \
--no-ansi \
--no-interaction \
--optimize-autoloader \
--no-scripts \
--no-progress
RUN chown -R www-data:root /var/www/pixelfed; \
find /var/www/pixelfed -type d -exec chmod 755 {} \;; \
find /var/www/pixelfed -type f -exec chmod 644 {} \;
RUN php artisan view:cache \
php artisan route:cache
COPY pixelfed /usr/local/bin/pixelfed
COPY pixelfed-cache /usr/local/bin/pixelfed-cache
COPY pixelfed-clean /usr/local/bin/pixelfed-clean
COPY pixelfed-run /usr/local/bin/pixelfed-run
COPY pixelfed-update /usr/local/bin/pixelfed-update
COPY pixelfed-garbage /usr/local/bin/pixelfed-garbage
COPY pixelfed-startup /usr/local/bin/pixelfed-startup
USER root
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/local/bin/pixelfed-startup", "/usr/local/bin/apache2-foreground"]

View file

@ -5,5 +5,6 @@ COMMAND=pixelfed-$1
if which $COMMAND; then
$COMMAND "${@:2}"
else
pixelfed-run "${@:1}"
echo "Could not find command"
exit 1
fi

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -xe
pixelfed php artisan view:cache
pixelfed php artisan route:cache
pixelfed php artisan media:optimize
pixelfed php artisan config:cache
pixelfed php artisan optimize

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -xe
pixelfed php artisan view:clear
pixelfed php artisan route:clear
pixelfed php artisan optimize:clear
pixelfed php artisan media:gc
pixelfed php artisan config:clear
pixelfed php artisan cache:clear
pixelfed php artisan clear-compiled

View file

@ -2,8 +2,4 @@
set -xe
pushd /home/pixelfed/live
pixelfed php artisan schedule:run
popd
php artisan schedule:run

View file

@ -2,6 +2,8 @@
set -xe
pixelfed update
php artisan media:optimize
php artisan config:cache
php artisan optimize
exec "$@"

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -xe
pixelfed clean
pixelfed composer install \
--no-ansi \
--no-interaction \
--no-progress \
--no-scripts \
--optimize-autoloader
pixelfed composer dump-autoload -o
pixelfed php artisan migrate --force
pixelfed php artisan update
pixelfed cache