1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-26 09:46:49 +00:00

Merge pull request #1184 from Shleeble/patch-2

Docker patch 2
This commit is contained in:
daniel 2019-04-24 19:07:34 -06:00 committed by GitHub
commit d92d9ddaf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 8 deletions

View file

@ -71,4 +71,5 @@ CS_CW_DOMAINS='example.org,example.net,example.com'
CS_UNLISTED_DOMAINS='example.org,example.net,example.com' CS_UNLISTED_DOMAINS='example.org,example.net,example.com'
## Optional ## Optional
HORIZON_DARKMODE=true # Horizon theme darkmode #HORIZON_DARKMODE=false # Horizon theme darkmode
#HORIZON_EMBED=false # Single Docker Container mode

View file

@ -1,11 +1,12 @@
FROM php:7.2-apache FROM php:7.3-apache
ARG COMPOSER_VERSION="1.8.5" ARG COMPOSER_VERSION="1.8.5"
ARG COMPOSER_CHECKSUM="4e4c1cd74b54a26618699f3190e6f5fc63bb308b13fa660f71f2a2df047c0e17" ARG COMPOSER_CHECKSUM="4e4c1cd74b54a26618699f3190e6f5fc63bb308b13fa660f71f2a2df047c0e17"
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y --no-install-recommends git gosu \ && apt-get install -y --no-install-recommends git gosu \
optipng pngquant jpegoptim gifsicle libpq-dev libsqlite3-dev locales zip unzip libzip-dev \ optipng pngquant jpegoptim gifsicle libpq-dev libsqlite3-dev locales zip unzip libzip-dev libcurl4-openssl-dev \
libfreetype6 libicu-dev libjpeg62-turbo libpng16-16 libxpm4 libwebp6 libmagickwand-6.q16-3 \ 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 \ libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev libmagickwand-dev \
&& sed -i '/en_US/s/^#//g' /etc/locale.gen \ && sed -i '/en_US/s/^#//g' /etc/locale.gen \
@ -16,9 +17,9 @@ RUN apt-get update \
--with-jpeg-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-xpm-dir=/usr/lib/x86_64-linux-gnu/ \
--with-webp-dir=/usr/lib/x86_64-linux-gnu/ \ --with-webp-dir=/usr/lib/x86_64-linux-gnu/ \
&& docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite pcntl gd exif bcmath intl zip \ && docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite pcntl gd exif bcmath intl zip curl \
&& pecl install imagick \ && pecl install imagick \
&& docker-php-ext-enable imagick pcntl imagick gd exif zip \ && docker-php-ext-enable imagick pcntl imagick gd exif zip curl \
&& a2enmod rewrite remoteip \ && a2enmod rewrite remoteip \
&& {\ && {\
echo RemoteIPHeader X-Real-IP ;\ echo RemoteIPHeader X-Real-IP ;\
@ -56,7 +57,6 @@ ENV APP_ENV=production \
DB_HOST=db \ DB_HOST=db \
BROADCAST_DRIVER=log \ BROADCAST_DRIVER=log \
QUEUE_DRIVER=redis \ QUEUE_DRIVER=redis \
HORIZON_EMBED=TRUE \
HORIZON_PREFIX=horizon-pixelfed \ HORIZON_PREFIX=horizon-pixelfed \
REDIS_HOST=redis \ REDIS_HOST=redis \
SESSION_SECURE_COOKIE=true \ SESSION_SECURE_COOKIE=true \

View file

@ -3,7 +3,13 @@
# Create the storage tree if needed and fix permissions # Create the storage tree if needed and fix permissions
cp -r storage.skel/* storage/ cp -r storage.skel/* storage/
chown -R www-data:www-data storage/ bootstrap/ chown -R www-data:www-data storage/ bootstrap/
# Refresh the environment
php artisan storage:link php artisan storage:link
php artisan horizon:assets
php artisan route:cache
php artisan view:cache
php artisan config:cache
# Migrate database if the app was upgraded # 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
@ -11,5 +17,10 @@ php artisan storage:link
# Run other specific migratins if required # Run other specific migratins if required
# gosu www-data:www-data php artisan update # 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
# Finally run Apache # Finally run Apache
exec apache2-foreground exec apache2-foreground

View file

@ -16,11 +16,14 @@ services:
# Comment to use dockerhub image # Comment to use dockerhub image
build: . build: .
image: pixelfed image: pixelfed
# If you have a traefik running, uncomment this to expose Pixelfed ## If you have a traefik running, uncomment this to expose Pixelfed
# labels: # labels:
# - traefik.enable=true # - traefik.enable=true
# - traefik.frontend.rule=Host:your.url # - traefik.frontend.rule=Host:your.url
# - traefik.port=80 # - traefik.port=80
## If you have a standard reverse proxy, uncommit this to expose Pixelfed
# ports:
# - "127.0.0.1:8080:80"
env_file: env_file:
- ./.env - ./.env
volumes: volumes:
@ -30,7 +33,7 @@ services:
- external - external
- internal - internal
worker: worker: # Comment this whole block if HORIZON_EMBED is true.
# Comment to use dockerhub image # Comment to use dockerhub image
build: . build: .
image: pixelfed image: pixelfed
@ -40,6 +43,7 @@ services:
- "app-storage:/var/www/storage" - "app-storage:/var/www/storage"
- "app-bootstrap:/var/www/bootstrap" - "app-bootstrap:/var/www/bootstrap"
networks: networks:
- external # Required for ActivityPub
- internal - internal
command: gosu www-data php artisan horizon command: gosu www-data php artisan horizon