Remove preivous image
This commit is contained in:
parent
e04f610382
commit
180ae441d9
|
@ -1,132 +0,0 @@
|
||||||
FROM arm64v8/php:7.4.1-apache-buster
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
\
|
|
||||||
savedAptMark="$(apt-mark showmanual)"; \
|
|
||||||
\
|
|
||||||
apt-get update; \
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
libcurl4-openssl-dev \
|
|
||||||
libevent-dev \
|
|
||||||
libfreetype6-dev \
|
|
||||||
libicu-dev \
|
|
||||||
libjpeg-dev \
|
|
||||||
libmcrypt-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libpq-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
libxpm-dev \
|
|
||||||
libmagickwand-dev \
|
|
||||||
libzip-dev \
|
|
||||||
libwebp-dev \
|
|
||||||
; \
|
|
||||||
\
|
|
||||||
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
|
|
||||||
docker-php-ext-install -j "$(nproc)" \
|
|
||||||
bcmath \
|
|
||||||
exif \
|
|
||||||
gd \
|
|
||||||
intl \
|
|
||||||
pcntl \
|
|
||||||
pdo_pgsql \
|
|
||||||
pgsql \
|
|
||||||
zip \
|
|
||||||
; \
|
|
||||||
\
|
|
||||||
pecl install imagick-3.4.4; \
|
|
||||||
docker-php-ext-enable imagick; \
|
|
||||||
\
|
|
||||||
apt-mark auto '.*' > /dev/null; \
|
|
||||||
apt-mark manual $savedAptMark; \
|
|
||||||
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
|
||||||
| awk '/=>/ { print $3 }' \
|
|
||||||
| sort -u \
|
|
||||||
| xargs -r dpkg-query -S \
|
|
||||||
| cut -d: -f1 \
|
|
||||||
| sort -u \
|
|
||||||
| xargs -rt apt-mark manual; \
|
|
||||||
\
|
|
||||||
apt-get purge -y --autoremove -o APT::AutoRemove::RecommendsImportant=false; \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN {\
|
|
||||||
echo memory_limit = 512M ;\
|
|
||||||
echo post_max_size = 42M ;\
|
|
||||||
echo file_uploads = On ;\
|
|
||||||
echo max_file_uploads = 20 ;\
|
|
||||||
echo max_execution_time = 1200 ;\
|
|
||||||
echo upload_max_filesize = 40M ;\
|
|
||||||
} > /usr/local/etc/php/conf.d/pixelfed.ini; \
|
|
||||||
chown -R www-data:root /var/www; \
|
|
||||||
chmod -R g=u /var/www
|
|
||||||
|
|
||||||
RUN a2enmod rewrite remoteip ;\
|
|
||||||
{\
|
|
||||||
echo RemoteIPHeader X-Real-IP ;\
|
|
||||||
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
|
|
||||||
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
|
|
||||||
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
|
|
||||||
} > /etc/apache2/conf-available/remoteip.conf;\
|
|
||||||
a2enconf remoteip
|
|
||||||
|
|
||||||
RUN mkdir /scratch
|
|
||||||
|
|
||||||
WORKDIR /scratch
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
SIGNATURE="$(curl https://composer.github.io/installer.sig)"; \
|
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; \
|
|
||||||
SIG="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"; \
|
|
||||||
test "$SIGNATURE" = "$SIG"; \
|
|
||||||
php composer-setup.php --install-dir /usr/local/bin --filename=composer
|
|
||||||
|
|
||||||
RUN rm -r /scratch
|
|
||||||
|
|
||||||
ENV TAG=VERSION
|
|
||||||
|
|
||||||
RUN set -ex; \
|
|
||||||
fetchDeps=git; \
|
|
||||||
apt-get update; \
|
|
||||||
apt-get install -y --no-install-recommends $fetchDeps
|
|
||||||
|
|
||||||
RUN rm -rf /var/www; \
|
|
||||||
git clone -b $TAG https://github.com/pixelfed/pixelfed /var/www; \
|
|
||||||
ln -s /var/www/public /var/www/html
|
|
||||||
|
|
||||||
RUN chown -R www-data:root /var/www; \
|
|
||||||
find /var/www -type d -exec chmod 755 {} \;; \
|
|
||||||
find /var/www -type f -exec chmod 644 {} \;
|
|
||||||
|
|
||||||
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 rsync; \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
USER www-data
|
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|
||||||
RUN composer install \
|
|
||||||
--no-ansi \
|
|
||||||
--no-interaction \
|
|
||||||
--optimize-autoloader \
|
|
||||||
--no-scripts \
|
|
||||||
--no-progress
|
|
||||||
|
|
||||||
RUN cp -r storage storage-default
|
|
||||||
|
|
||||||
USER root
|
|
||||||
|
|
||||||
COPY pixelfed /usr/local/bin/pixelfed
|
|
||||||
COPY pixelfed-run /usr/local/bin/pixelfed-run
|
|
||||||
COPY pixelfed-horizon /usr/local/bin/pixelfed-horizon
|
|
||||||
COPY pixelfed-startup /usr/local/bin/pixelfed-startup
|
|
||||||
COPY pixelfed-migrate /usr/local/bin/pixelfed-migrate
|
|
||||||
COPY pixelfed-garbage /usr/local/bin/pixelfed-garbage
|
|
||||||
|
|
||||||
VOLUME /var/www/storage
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
||||||
CMD ["/usr/local/bin/pixelfed-startup", "/usr/local/bin/apache2-foreground"]
|
|
|
@ -1,58 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
BUILD_DATE=$(date)
|
|
||||||
VERSION=$1
|
|
||||||
PIXELFED_RELEASE=$2
|
|
||||||
|
|
||||||
function require() {
|
|
||||||
if [ "$1" = "" ]; then
|
|
||||||
echo "input '$2' required"
|
|
||||||
print_help
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function print_help() {
|
|
||||||
echo "build.sh"
|
|
||||||
echo ""
|
|
||||||
echo "Usage:"
|
|
||||||
echo " build.sh [version] [pixelfed_release]"
|
|
||||||
echo ""
|
|
||||||
echo "Args:"
|
|
||||||
echo " version: The version of the current container"
|
|
||||||
echo " pixelfed_release: The release of pixelfed to include"
|
|
||||||
}
|
|
||||||
|
|
||||||
function build_image() {
|
|
||||||
IMAGE=$1
|
|
||||||
ARCH=$2
|
|
||||||
|
|
||||||
docker build \
|
|
||||||
--pull \
|
|
||||||
--no-cache \
|
|
||||||
--build-arg BUILD_DATE="${BUILD_DATE}" \
|
|
||||||
--build-arg PIXELFED_RELEASE="${PIXELFED_RELEASE}" \
|
|
||||||
--build-arg VERSION="${VERSION}" \
|
|
||||||
-f "Dockerfile.${ARCH}" \
|
|
||||||
-t "${IMAGE}:${PIXELFED_RELEASE}-${VERSION}-${ARCH}" \
|
|
||||||
-t "${IMAGE}:latest-${ARCH}" \
|
|
||||||
-t "${IMAGE}:latest" \
|
|
||||||
.
|
|
||||||
|
|
||||||
docker push "${IMAGE}:${PIXELFED_RELEASE}-${VERSION}-${ARCH}"
|
|
||||||
docker push "${IMAGE}:latest-${ARCH}"
|
|
||||||
docker push "${IMAGE}:latest"
|
|
||||||
}
|
|
||||||
|
|
||||||
require "$VERSION" "version"
|
|
||||||
require "$PIXELFED_RELEASE" "pixelfed release"
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
pushd base
|
|
||||||
build_image asonix/pixelfed-base arm64v8
|
|
||||||
popd
|
|
||||||
|
|
||||||
pushd web
|
|
||||||
build_image asonix/pixelfed arm64v8
|
|
||||||
popd
|
|
8
pixelfed/base/root/usr/bin/pixelfed-migrate
Executable file
8
pixelfed/base/root/usr/bin/pixelfed-migrate
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
cd /srv/www/pixelfed
|
||||||
|
|
||||||
|
pixelfed php artisan migrate --force
|
||||||
|
pixelfed php artisan update
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin//env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
TAG=$1
|
BUILD_DATE=$(date)
|
||||||
|
VERSION=$1
|
||||||
|
PIXELFED_RELEASE=$2
|
||||||
|
|
||||||
function require() {
|
function require() {
|
||||||
if [ "$1" = "" ]; then
|
if [ "$1" = "" ]; then
|
||||||
|
@ -14,29 +16,43 @@ function print_help() {
|
||||||
echo "build.sh"
|
echo "build.sh"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " build.sh [tag]"
|
echo " build.sh [version] [pixelfed_release]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Args:"
|
echo "Args:"
|
||||||
echo " tag: The tag of the pixelfed image the target image is based on"
|
echo " version: The version of the current container"
|
||||||
|
echo " pixelfed_release: The release of pixelfed to include"
|
||||||
}
|
}
|
||||||
|
|
||||||
require "$TAG" tag
|
function build_image() {
|
||||||
|
IMAGE=$1
|
||||||
|
ARCH=$2
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
--pull \
|
||||||
|
--no-cache \
|
||||||
|
--build-arg BUILD_DATE="${BUILD_DATE}" \
|
||||||
|
--build-arg PIXELFED_RELEASE="${PIXELFED_RELEASE}" \
|
||||||
|
--build-arg VERSION="${VERSION}" \
|
||||||
|
-f "Dockerfile.${ARCH}" \
|
||||||
|
-t "${IMAGE}:${PIXELFED_RELEASE}-${VERSION}-${ARCH}" \
|
||||||
|
-t "${IMAGE}:latest-${ARCH}" \
|
||||||
|
-t "${IMAGE}:latest" \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker push "${IMAGE}:${PIXELFED_RELEASE}-${VERSION}-${ARCH}"
|
||||||
|
docker push "${IMAGE}:latest-${ARCH}"
|
||||||
|
docker push "${IMAGE}:latest"
|
||||||
|
}
|
||||||
|
|
||||||
|
require "$VERSION" "version"
|
||||||
|
require "$PIXELFED_RELEASE" "pixelfed release"
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
sed "s/VERSION/$TAG/g" Dockerfile > "Dockerfile.$TAG"
|
pushd base
|
||||||
|
build_image asonix/pixelfed-base arm64v8
|
||||||
|
popd
|
||||||
|
|
||||||
docker build \
|
pushd web
|
||||||
--pull \
|
build_image asonix/pixelfed arm64v8
|
||||||
--no-cache \
|
popd
|
||||||
-f "Dockerfile.$TAG" \
|
|
||||||
-t "asonix/pixelfed:$TAG-arm64v8" \
|
|
||||||
-t asonix/pixelfed:latest-arm64v8 \
|
|
||||||
-t asonix/pixelfed:latest \
|
|
||||||
.
|
|
||||||
|
|
||||||
docker push "asonix/pixelfed:$TAG-arm64v8"
|
|
||||||
docker push asonix/pixelfed:latest-arm64v8
|
|
||||||
docker push asonix/pixelfed:latest
|
|
||||||
|
|
||||||
rm "Dockerfile.$TAG"
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
COMMAND=pixelfed-$1
|
|
||||||
|
|
||||||
if which $COMMAND; then
|
|
||||||
$COMMAND "${@:2}"
|
|
||||||
else
|
|
||||||
pixelfed-run "${@:1}"
|
|
||||||
fi
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
pixelfed 'php artisan media:optimize'
|
|
||||||
pixelfed 'php artisan media:gc'
|
|
||||||
pixelfed 'php artisan horizon:snapshot'
|
|
||||||
pixelfed 'php artisan story:gc'
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
pixelfed 'php artisan config:cache'
|
|
||||||
pixelfed 'php artisan storage:link'
|
|
||||||
pixelfed 'php artisan horizon'
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
pixelfed 'php artisan migrate --force'
|
|
||||||
pixelfed 'php artisan update'
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
su www-data -s /bin/sh -c "$@"
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
echo "ServerName ${APP_DOMAIN}" > /etc/apache2/conf-available/servername.conf
|
|
||||||
a2enconf servername
|
|
||||||
|
|
||||||
pixelfed 'rsync -rog storage-default/* storage/'
|
|
||||||
pixelfed 'php artisan config:cache'
|
|
||||||
pixelfed 'php artisan storage:link'
|
|
||||||
pixelfed 'php artisan horizon:install'
|
|
||||||
pixelfed 'php artisan horizon:assets'
|
|
||||||
pixelfed 'php artisan route:cache'
|
|
||||||
pixelfed 'php artisan view:cache'
|
|
||||||
pixelfed 'php artisan optimize'
|
|
||||||
|
|
||||||
exec "$@"
|
|
Loading…
Reference in a new issue