diff --git a/.env.example b/.env.example index 652864625..f5f44745b 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,9 @@ APP_URL=http://localhost ADMIN_DOMAIN="localhost" APP_DOMAIN="localhost" +SESSION_DOMAIN="localhost" +SESSION_SECURE_COOKIE=true +TRUST_PROXIES="*" LOG_CHANNEL=stack @@ -35,8 +38,6 @@ MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="pixelfed@example.com" MAIL_FROM_NAME="Pixelfed" -SESSION_DOMAIN="${APP_DOMAIN}" -SESSION_SECURE_COOKIE=true API_BASE="/api/1/" API_SEARCH="/api/search" @@ -54,19 +55,20 @@ MIX_APP_URL="${APP_URL}" MIX_API_BASE="${API_BASE}" MIX_API_SEARCH="${API_SEARCH}" +ACTIVITY_PUB=false +REMOTE_FOLLOW=false ACTIVITYPUB_INBOX=false ACTIVITYPUB_SHAREDINBOX=false -HORIZON_DARKMODE=true - -# Set these both "true" to enable federation. +# Set these "true" to enable federation. # You might need to also run: # php artisan cache:clear # php artisan optimize:clear # php artisan optimize -ACTIVITY_PUB=false -REMOTE_FOLLOW=false PF_COSTAR_ENABLED=false CS_BLOCKED_DOMAINS='example.org,example.net,example.com' CS_CW_DOMAINS='example.org,example.net,example.com' CS_UNLISTED_DOMAINS='example.org,example.net,example.com' + +## Optional +HORIZON_DARKMODE=true # Horizon theme darkmode diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache index 7835f6c8b..d42602a14 100644 --- a/contrib/docker/Dockerfile.apache +++ b/contrib/docker/Dockerfile.apache @@ -1,22 +1,24 @@ FROM php:7.2-apache -ARG COMPOSER_VERSION="1.6.5" -ARG COMPOSER_CHECKSUM="67bebe9df9866a795078bb2cf21798d8b0214f2e0b2fd81f2e907a8ef0be3434" +ARG COMPOSER_VERSION="1.8.5" +ARG COMPOSER_CHECKSUM="4e4c1cd74b54a26618699f3190e6f5fc63bb308b13fa660f71f2a2df047c0e17" RUN apt-get update \ && apt-get install -y --no-install-recommends git gosu \ - optipng pngquant jpegoptim gifsicle \ + optipng pngquant jpegoptim gifsicle libpq-dev libsqlite3-dev locales zip unzip libzip-dev \ libfreetype6 libicu-dev libjpeg62-turbo libpng16-16 libxpm4 libwebp6 libmagickwand-6.q16-3 \ libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev libmagickwand-dev \ + && sed -i '/en_US/s/^#//g' /etc/locale.gen \ + && locale-gen && update-locale \ && docker-php-source extract \ && docker-php-ext-configure gd \ --with-freetype-dir=/usr/lib/x86_64-linux-gnu/ \ --with-jpeg-dir=/usr/lib/x86_64-linux-gnu/ \ --with-xpm-dir=/usr/lib/x86_64-linux-gnu/ \ --with-webp-dir=/usr/lib/x86_64-linux-gnu/ \ - && docker-php-ext-install pdo_mysql pcntl gd exif bcmath intl \ + && docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite pcntl gd exif bcmath intl zip \ && pecl install imagick \ - && docker-php-ext-enable imagick pcntl imagick gd exif \ + && docker-php-ext-enable imagick pcntl imagick gd exif zip \ && a2enmod rewrite remoteip \ && {\ echo RemoteIPHeader X-Real-IP ;\ @@ -44,7 +46,7 @@ RUN cp -r storage storage.skel \ && composer install --prefer-source --no-interaction \ && rm -rf html && ln -s public html -VOLUME ["/var/www/storage"] +VOLUME /var/www/storage /var/www/bootstrap ENV APP_ENV=production \ APP_DEBUG=false \ diff --git a/contrib/docker/Dockerfile.fpm b/contrib/docker/Dockerfile.fpm index fc7524429..3cc9a3f46 100644 --- a/contrib/docker/Dockerfile.fpm +++ b/contrib/docker/Dockerfile.fpm @@ -1,22 +1,24 @@ FROM php:7.2-fpm -ARG COMPOSER_VERSION="1.6.5" -ARG COMPOSER_CHECKSUM="67bebe9df9866a795078bb2cf21798d8b0214f2e0b2fd81f2e907a8ef0be3434" +ARG COMPOSER_VERSION="1.8.5" +ARG COMPOSER_CHECKSUM="4e4c1cd74b54a26618699f3190e6f5fc63bb308b13fa660f71f2a2df047c0e17" RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - optipng pngquant jpegoptim gifsicle \ + && apt-get install -y --no-install-recommends git gosu \ + optipng pngquant jpegoptim gifsicle libpq-dev libsqlite3-dev locales zip unzip libzip-dev \ libfreetype6 libjpeg62-turbo libpng16-16 libxpm4 libvpx4 libmagickwand-6.q16-3 \ libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libvpx-dev libmagickwand-dev \ + && sed -i '/en_US/s/^#//g' /etc/locale.gen \ + && locale-gen && update-locale \ && docker-php-source extract \ && docker-php-ext-configure gd \ --with-freetype-dir=/usr/lib/x86_64-linux-gnu/ \ --with-jpeg-dir=/usr/lib/x86_64-linux-gnu/ \ --with-xpm-dir=/usr/lib/x86_64-linux-gnu/ \ --with-vpx-dir=/usr/lib/x86_64-linux-gnu/ \ - && docker-php-ext-install pdo_mysql pcntl gd exif bcmath \ + && docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite pcntl gd exif bcmath intl zip \ && pecl install imagick \ - && docker-php-ext-enable imagick pcntl imagick gd exif \ + && docker-php-ext-enable imagick pcntl imagick gd exif zip \ && curl -LsS https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -o /usr/bin/composer \ && echo "${COMPOSER_CHECKSUM} /usr/bin/composer" | sha256sum -c - \ && chmod 755 /usr/bin/composer \ @@ -35,7 +37,7 @@ RUN cp -r storage storage.skel \ && composer install --prefer-dist --no-interaction \ && rm -rf html && ln -s public html -VOLUME ["/var/www/storage", "/var/www/public.ext"] +VOLUME /var/www/storage /var/www/bootstrap ENV APP_ENV=production \ APP_DEBUG=false \ diff --git a/contrib/docker/start.sh b/contrib/docker/start.sh index 7bc26c0db..3468f519c 100755 --- a/contrib/docker/start.sh +++ b/contrib/docker/start.sh @@ -2,19 +2,14 @@ # Create the storage tree if needed and fix permissions cp -r storage.skel/* storage/ -chown -R www-data:www-data storage/ bootstrap/cache/ +chown -R www-data:www-data storage/ bootstrap/ php artisan storage:link # Migrate database if the app was upgraded -gosu www-data:www-data php artisan migrate --force +# gosu www-data:www-data php artisan migrate --force # Run other specific migratins if required -gosu www-data:www-data php artisan update - -# Run a worker if it is set as embedded -if [ "$HORIZON_EMBED" = "true" ]; then - gosu www-data:www-data php artisan horizon & -fi +# gosu www-data:www-data php artisan update # Finally run Apache exec apache2-foreground diff --git a/docker-compose.yml b/docker-compose.yml index a010930a4..f93e77d77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,8 @@ version: '3' services: app: - # Uncomment to build a local copy of the image - # build: . + # Comment to use dockerhub image + build: . image: pixelfed # If you have a traefik running, uncomment this to expose Pixelfed # labels: @@ -25,20 +25,23 @@ services: - ./.env volumes: - "app-storage:/var/www/storage" + - "app-bootstrap:/var/www/bootstrap" networks: - external - internal - # Uncomment if you set HORIZON_EMBED to false and wish to run a local worker - # worker: - # image: pixelfed - # env_file: - # - ./.env - # volumes: - # - "app-storage:/var/www/storage" - # networks: - # - internal - # command: gosu www-data php artisan horizon + worker: + # Comment to use dockerhub image + build: . + image: pixelfed + env_file: + - ./.env + volumes: + - "app-storage:/var/www/storage" + - "app-bootstrap:/var/www/bootstrap" + networks: + - internal + command: gosu www-data php artisan horizon db: image: mysql:5.7 @@ -53,7 +56,7 @@ services: - "db-data:/var/lib/mysql" redis: - image: redis:4-alpine + image: redis:5-alpine volumes: - "redis-data:/data" networks: @@ -64,6 +67,7 @@ volumes: redis-data: db-data: app-storage: + app-bootstrap: networks: internal: