diff --git a/pixelfed/base/Dockerfile.arm64v8 b/pixelfed/Dockerfile.arm64v8 similarity index 85% rename from pixelfed/base/Dockerfile.arm64v8 rename to pixelfed/Dockerfile.arm64v8 index a19d71d..f2cb34b 100644 --- a/pixelfed/base/Dockerfile.arm64v8 +++ b/pixelfed/Dockerfile.arm64v8 @@ -1,4 +1,4 @@ -FROM lsiobase/alpine:arm64v8-3.11 +FROM lsiobase/nginx:arm64v8-3.11 # set version label ARG BUILD_DATE @@ -13,43 +13,28 @@ ENV PIXELFED_PATH="/srv/www/pixelfed" RUN \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - apache2-utils \ curl \ ffmpeg \ - git \ imagemagick \ jpegoptim \ - libressl3.0-libssl \ libxml2 \ - nano \ - openssl \ optipng \ - php7 \ php7-bcmath \ php7-ctype \ php7-curl \ php7-dom \ php7-exif \ - php7-fileinfo \ php7-gd \ php7-iconv \ php7-imagick \ php7-intl \ - php7-json \ - php7-mbstring \ - php7-openssl \ php7-pcntl \ php7-pdo_pgsql \ php7-pgsql \ php7-phar \ php7-posix \ - php7-session \ - php7-simplexml \ php7-tokenizer \ - php7-xml \ - php7-xmlwriter \ php7-zip \ - php7-zlib \ pngquant \ rsync \ sudo \ @@ -98,4 +83,5 @@ USER root # copy local files COPY root/ / +EXPOSE 80 VOLUME /srv/www/pixelfed/storage diff --git a/pixelfed/build.sh b/pixelfed/build.sh index ea48cc8..26b1f04 100755 --- a/pixelfed/build.sh +++ b/pixelfed/build.sh @@ -49,10 +49,4 @@ require "$PIXELFED_RELEASE" "pixelfed release" set -xe -pushd base -build_image asonix/pixelfed-base arm64v8 -popd - -pushd web build_image asonix/pixelfed arm64v8 -popd diff --git a/pixelfed/web/root/defaults/default b/pixelfed/root/defaults/default similarity index 100% rename from pixelfed/web/root/defaults/default rename to pixelfed/root/defaults/default diff --git a/pixelfed/base/root/defaults/pixelfed-perms.sh b/pixelfed/root/defaults/pixelfed-perms.sh similarity index 100% rename from pixelfed/base/root/defaults/pixelfed-perms.sh rename to pixelfed/root/defaults/pixelfed-perms.sh diff --git a/pixelfed/base/root/etc/cont-init.d/50-install b/pixelfed/root/etc/cont-init.d/50-install similarity index 100% rename from pixelfed/base/root/etc/cont-init.d/50-install rename to pixelfed/root/etc/cont-init.d/50-install diff --git a/pixelfed/base/root/usr/bin/pixelfed b/pixelfed/root/usr/bin/pixelfed similarity index 100% rename from pixelfed/base/root/usr/bin/pixelfed rename to pixelfed/root/usr/bin/pixelfed diff --git a/pixelfed/base/root/usr/bin/pixelfed-garbage b/pixelfed/root/usr/bin/pixelfed-garbage similarity index 100% rename from pixelfed/base/root/usr/bin/pixelfed-garbage rename to pixelfed/root/usr/bin/pixelfed-garbage diff --git a/pixelfed/base/root/usr/bin/pixelfed-horizon b/pixelfed/root/usr/bin/pixelfed-horizon similarity index 100% rename from pixelfed/base/root/usr/bin/pixelfed-horizon rename to pixelfed/root/usr/bin/pixelfed-horizon diff --git a/pixelfed/base/root/usr/bin/pixelfed-migrate b/pixelfed/root/usr/bin/pixelfed-migrate similarity index 100% rename from pixelfed/base/root/usr/bin/pixelfed-migrate rename to pixelfed/root/usr/bin/pixelfed-migrate diff --git a/pixelfed/base/root/usr/bin/pixelfed-run b/pixelfed/root/usr/bin/pixelfed-run similarity index 100% rename from pixelfed/base/root/usr/bin/pixelfed-run rename to pixelfed/root/usr/bin/pixelfed-run diff --git a/pixelfed/web/Dockerfile.arm64v8 b/pixelfed/web/Dockerfile.arm64v8 deleted file mode 100644 index e65d940..0000000 --- a/pixelfed/web/Dockerfile.arm64v8 +++ /dev/null @@ -1,34 +0,0 @@ -FROM asonix/pixelfed-base:latest-arm64v8 - -# set version label -ARG BUILD_DATE -ARG VERSION -ARG PIXELFED_RELEASE -LABEL build_version="Build version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="asonix" - -# environment settings -ENV PIXELFED_PATH="/srv/www/pixelfed" - -RUN \ - echo "**** install runtime packages ****" && \ - apk add --no-cache --upgrade \ - logrotate \ - nginx \ - php7-fpm && \ - echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \ - sed -i'' 's/;clear_env.*/clear_env = no/g' /etc/php7/php-fpm.d/www.conf && \ - echo "**** configure nginx ****" && \ - echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> \ - /etc/nginx/fastcgi_params && \ - rm -f /etc/nginx/conf.d/default.conf && \ - echo "**** fix logrotate ****" && \ - sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \ - sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \ - /etc/periodic/daily/logrotate - -# copy local files -COPY root/ / - -EXPOSE 80 -VOLUME /srv/www/pixelfed/storage diff --git a/pixelfed/web/root/defaults/nginx.conf b/pixelfed/web/root/defaults/nginx.conf deleted file mode 100644 index 5a3dae0..0000000 --- a/pixelfed/web/root/defaults/nginx.conf +++ /dev/null @@ -1,101 +0,0 @@ -## Version 2018/08/16 - Changelog: https://github.com/linuxserver/docker-baseimage-alpine-nginx/commits/master/root/defaults/nginx.conf - -user abc; -worker_processes 4; -pid /run/nginx.pid; -include /etc/nginx/modules/*.conf; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - - ## - # Basic Settings - ## - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - # server_tokens off; - - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; - - client_max_body_size 0; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - ## - # Logging Settings - ## - - access_log /config/log/nginx/access.log; - error_log /config/log/nginx/error.log; - - ## - # Gzip Settings - ## - - gzip on; - gzip_disable "msie6"; - - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; - - ## - # nginx-naxsi config - ## - # Uncomment it if you installed nginx-naxsi - ## - - #include /etc/nginx/naxsi_core.rules; - - ## - # nginx-passenger config - ## - # Uncomment it if you installed nginx-passenger - ## - - #passenger_root /usr; - #passenger_ruby /usr/bin/ruby; - - ## - # Virtual Host Configs - ## - include /etc/nginx/conf.d/*.conf; - include /config/nginx/site-confs/*; - -} - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} -daemon off; diff --git a/pixelfed/web/root/defaults/pixelfed-perms.sh b/pixelfed/web/root/defaults/pixelfed-perms.sh deleted file mode 100755 index f210e2e..0000000 --- a/pixelfed/web/root/defaults/pixelfed-perms.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -pfpath="${PIXELFED_PATH}" -htuser='abc' -htgroup='abc' -rootuser='root' - -printf "chmod Files and Directories\n" -find ${pfpath}/ -type f -print0 | xargs -0 chmod 0640 -find ${pfpath}/ -type d -print0 | xargs -0 chmod 0750 - -printf "chown Directories\n" -chown -R ${rootuser}:${htgroup} ${pfpath}/ -chown -R ${htuser}:${htgroup} ${pfpath}/app/ -chown -R ${htuser}:${htgroup} ${pfpath}/bootstrap/ -chown -R ${htuser}:${htgroup} ${pfpath}/config/ -chown -R ${htuser}:${htgroup} ${pfpath}/public/ -chown -R ${htuser}:${htgroup} ${pfpath}/resources/ -chown -R ${htuser}:${htgroup} ${pfpath}/routes/ -chown -R ${htuser}:${htgroup} ${pfpath}/storage/ - -chmod +x ${pfpath}/artisan - -printf "chmod/chown .htaccess\n" -if [ -f ${pfpath}/public/.htaccess ] - then - chmod 0644 ${pfpath}/public/.htaccess - chown ${rootuser}:${htgroup} ${pfpath}/.htaccess -fi diff --git a/pixelfed/web/root/etc/cont-init.d/20-config b/pixelfed/web/root/etc/cont-init.d/20-config deleted file mode 100755 index b66e7e0..0000000 --- a/pixelfed/web/root/etc/cont-init.d/20-config +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/with-contenv bash - -# make our folders -mkdir -p \ - /config/{nginx/site-confs,www,log/nginx,keys,log/php,php} \ - /run \ - /var/lib/nginx/tmp/client_body \ - /var/tmp/nginx - -# copy config files -[[ ! -f /config/nginx/nginx.conf ]] && \ - cp /defaults/nginx.conf /config/nginx/nginx.conf -[[ ! -f /config/nginx/site-confs/default ]] && \ - cp /defaults/default /config/nginx/site-confs/default -[[ $(find /config/www -type f | wc -l) -eq 0 ]] && \ - cp /defaults/index.html /config/www/index.html - -# create local php.ini if it doesn't exist, set local timezone -[[ ! -f /config/php/php-local.ini ]] && \ - printf "; Edit this file to override php.ini directives and restart the container\\n\\ndate.timezone = %s\\n" "$TZ" > /config/php/php-local.ini -# copy user php-local.ini to image -cp /config/php/php-local.ini /etc/php7/conf.d/php-local.ini -#fix php-fpm log location -sed -i "s#;error_log = log/php7/error.log.*#error_log = /config/log/php/error.log#g" /etc/php7/php-fpm.conf -#fix php-fpm user -sed -i "s#user = nobody.*#user = abc#g" /etc/php7/php-fpm.d/www.conf -sed -i "s#group = nobody.*#group = abc#g" /etc/php7/php-fpm.d/www.conf -# create override for www.conf if it doesn't exist -[[ ! -f /config/php/www2.conf ]] && \ - printf "; Edit this file to override www.conf and php-fpm.conf directives and restart the container\\n\\n; Pool name\\n[www]\\n\\n" > /config/php/www2.conf -# copy user www2.conf to image -cp /config/php/www2.conf /etc/php7/php-fpm.d/www2.conf - -# permissions -chown -R abc:abc \ - /config \ - /var/lib/nginx \ - /var/tmp/nginx -chmod -R g+w \ - /config/{nginx,www} -chmod -R 644 /etc/logrotate.d diff --git a/pixelfed/web/root/etc/cont-init.d/40-config b/pixelfed/web/root/etc/cont-init.d/40-config deleted file mode 100755 index d4eb156..0000000 --- a/pixelfed/web/root/etc/cont-init.d/40-config +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/with-contenv bash - -# permissions -chown abc:abc \ - /config -chown -R abc:abc \ - /var/lib/nginx diff --git a/pixelfed/web/root/etc/cont-init.d/50-install b/pixelfed/web/root/etc/cont-init.d/50-install deleted file mode 100755 index 1779268..0000000 --- a/pixelfed/web/root/etc/cont-init.d/50-install +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/with-contenv bash - -# prepare app -pushd "${PIXELFED_PATH}" -pixelfed rsync -rog storage-default/* storage/ -pixelfed php artisan storage:link -pixelfed php artisan config:cache -pixelfed php artisan horizon:install -pixelfed php artisan horizon:assets -pixelfed php artisan route:cache -pixelfed php artisan view:cache -pixelfed php artisan optimize -popd diff --git a/pixelfed/web/root/etc/logrotate.d/nginx b/pixelfed/web/root/etc/logrotate.d/nginx deleted file mode 100644 index a37b8c8..0000000 --- a/pixelfed/web/root/etc/logrotate.d/nginx +++ /dev/null @@ -1,14 +0,0 @@ -/config/log/nginx/*.log { - weekly - rotate 14 - compress - delaycompress - nodateext - notifempty - missingok - sharedscripts - postrotate - s6-svc -h /var/run/s6/services/nginx - endscript - su abc abc -} diff --git a/pixelfed/web/root/etc/logrotate.d/php-fpm7 b/pixelfed/web/root/etc/logrotate.d/php-fpm7 deleted file mode 100644 index 865547f..0000000 --- a/pixelfed/web/root/etc/logrotate.d/php-fpm7 +++ /dev/null @@ -1,14 +0,0 @@ -/config/log/php/*.log { - rotate 7 - weekly - missingok - notifempty - delaycompress - compress - nodateext - sharedscripts - postrotate - s6-svc -t /var/run/s6/services/php-fpm - endscript - su abc abc -} diff --git a/pixelfed/web/root/etc/services.d/nginx/run b/pixelfed/web/root/etc/services.d/nginx/run deleted file mode 100755 index ad337c6..0000000 --- a/pixelfed/web/root/etc/services.d/nginx/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec /usr/sbin/nginx -c /config/nginx/nginx.conf diff --git a/pixelfed/web/root/etc/services.d/php-fpm/run b/pixelfed/web/root/etc/services.d/php-fpm/run deleted file mode 100755 index 158771e..0000000 --- a/pixelfed/web/root/etc/services.d/php-fpm/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec /usr/sbin/php-fpm7 -F