mirror of
https://github.com/friendica/friendica
synced 2024-11-09 16:22:56 +00:00
Aligining the Dockerfile with the version in friendica/docker repository
This commit is contained in:
parent
07d6500700
commit
f1301aec73
9 changed files with 157 additions and 29 deletions
|
@ -1,7 +1,11 @@
|
||||||
ARG VARIANT="8.0-apache-bullseye"
|
ARG VARIANT="8.2-apache-bullseye"
|
||||||
FROM mcr.microsoft.com/vscode/devcontainers/php:${VARIANT}
|
FROM mcr.microsoft.com/vscode/devcontainers/php:${VARIANT}
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ARG apcu_version=5.1.23
|
||||||
|
ARG memcached_version=3.2.0
|
||||||
|
ARG redis_version=6.0.2
|
||||||
|
ARG imagick_version=3.7.0
|
||||||
|
|
||||||
RUN apt-get update -y;
|
RUN apt-get update -y;
|
||||||
|
|
||||||
|
@ -11,12 +15,22 @@ RUN apt-get install -y mariadb-client
|
||||||
# Base packages
|
# Base packages
|
||||||
RUN apt install -y vim software-properties-common sudo nano gnupg2
|
RUN apt install -y vim software-properties-common sudo nano gnupg2
|
||||||
|
|
||||||
RUN apt-get install -y \
|
# entrypoint.sh and cron.sh dependencies
|
||||||
|
RUN apt-get install -y --no-install-recommends \
|
||||||
|
rsync \
|
||||||
|
bzip2 \
|
||||||
|
msmtp \
|
||||||
|
tini
|
||||||
|
|
||||||
|
RUN apt-get install -y --no-install-recommends \
|
||||||
|
bash \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
libtool \
|
libtool \
|
||||||
libmagick++-dev \
|
libmagick++-dev \
|
||||||
libmemcached-dev \
|
libmemcached-dev \
|
||||||
|
zlib1g-dev \
|
||||||
|
libssl-dev \
|
||||||
libgraphicsmagick1-dev \
|
libgraphicsmagick1-dev \
|
||||||
libfreetype6-dev \
|
libfreetype6-dev \
|
||||||
libwebp-dev \
|
libwebp-dev \
|
||||||
|
@ -25,18 +39,58 @@ RUN apt-get install -y \
|
||||||
libldap2-dev \
|
libldap2-dev \
|
||||||
libgmp-dev \
|
libgmp-dev \
|
||||||
libmagickcore-6.q16-6-extra \
|
libmagickcore-6.q16-6-extra \
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
|
; \
|
||||||
&& docker-php-ext-install -j$(nproc) \
|
\
|
||||||
pdo_mysql \
|
docker-php-ext-configure gd \
|
||||||
gd \
|
--with-freetype \
|
||||||
exif \
|
--with-jpeg \
|
||||||
zip \
|
--with-webp \
|
||||||
opcache \
|
; \
|
||||||
ctype \
|
docker-php-ext-install -j "$(nproc)" \
|
||||||
pcntl \
|
pdo_mysql \
|
||||||
ldap \
|
gd \
|
||||||
gmp \
|
exif \
|
||||||
intl
|
zip \
|
||||||
|
opcache \
|
||||||
|
ctype \
|
||||||
|
pcntl \
|
||||||
|
ldap \
|
||||||
|
gmp \
|
||||||
|
intl
|
||||||
|
|
||||||
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
|
RUN pecl install apcu-${apcu_version}; \
|
||||||
|
pecl install memcached-${memcached_version}; \
|
||||||
|
# pecl install redis-${redis_version}; \
|
||||||
|
# pecl install imagick-${imagick_version}; \
|
||||||
|
docker-php-ext-enable \
|
||||||
|
apcu \
|
||||||
|
memcached
|
||||||
|
# redis \
|
||||||
|
# imagick
|
||||||
|
|
||||||
RUN apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
RUN apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV PHP_MEMORY_LIMIT 512M
|
||||||
|
ENV PHP_UPLOAD_LIMIT 512M
|
||||||
|
|
||||||
|
RUN { \
|
||||||
|
echo 'opcache.enable=1' ; \
|
||||||
|
echo 'opcache.interned_strings_buffer=8'; \
|
||||||
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
|
echo 'opcache.memory_consumption=128'; \
|
||||||
|
echo 'opcache.save_comments=1'; \
|
||||||
|
echo 'opcache.revalidte_freq=1'; \
|
||||||
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
|
\
|
||||||
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
\
|
||||||
|
{ \
|
||||||
|
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
|
||||||
|
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
|
||||||
|
} > /usr/local/etc/php/conf.d/friendica.ini; \
|
||||||
|
ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini; \
|
||||||
|
\
|
||||||
|
mkdir /var/www/data; \
|
||||||
|
chmod -R g=u /var/www
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
"postStartCommand": "service apache2 start",
|
"postStartCommand": "service apache2 start",
|
||||||
|
|
||||||
"forwardPorts": [
|
"forwardPorts": [
|
||||||
80,
|
|
||||||
443,
|
|
||||||
3306,
|
|
||||||
8080
|
8080
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -38,8 +35,8 @@
|
||||||
"php.suggest.basic": false
|
"php.suggest.basic": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
"remoteUser": "vscode"
|
//"remoteUser": "root"
|
||||||
}
|
}
|
||||||
|
|
11
.devcontainer/include/00apcu.config.php
Normal file
11
.devcontainer/include/00apcu.config.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If nothing else set, use APCu as a caching driver (best performance for local caching)
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
'system' => [
|
||||||
|
'cache_driver' => 'apcu',
|
||||||
|
],
|
||||||
|
];
|
17
.devcontainer/include/01redis.config.php
Normal file
17
.devcontainer/include/01redis.config.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST')) {
|
||||||
|
return [
|
||||||
|
'system' => [
|
||||||
|
'session_handler' => 'cache',
|
||||||
|
'distributed_cache_driver' => 'redis',
|
||||||
|
'lock_driver' => 'redis',
|
||||||
|
'redis_host' => getenv('REDIS_HOST'),
|
||||||
|
'redis_port' => (getenv('REDIS_PORT') ?: ''),
|
||||||
|
'redis_password' => (getenv('REDIS_PW') ?: ''),
|
||||||
|
'redis_db' => (getenv('REDIS_DB') ?: 0),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
|
@ -31,7 +31,6 @@ return [
|
||||||
'default_timezone' => 'UTC',
|
'default_timezone' => 'UTC',
|
||||||
'language' => 'en',
|
'language' => 'en',
|
||||||
'basepath' => '${workspaceFolder}',
|
'basepath' => '${workspaceFolder}',
|
||||||
'url' => 'http://${ServerName}:${ServerPort}',
|
'url' => 'http://${ServerName}:${ServerPort}'
|
||||||
'pidfile' => '/tmp/daemon.pid',
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
34
.devcontainer/include/zz-docker.config.php
Normal file
34
.devcontainer/include/zz-docker.config.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fallback config to make it possible overwriting config values
|
||||||
|
* because of docker environment variables
|
||||||
|
*
|
||||||
|
* This doesn't affect DB configurations, but will replace other config values
|
||||||
|
*/
|
||||||
|
|
||||||
|
$config = [
|
||||||
|
'system' => [
|
||||||
|
// Necessary because otherwise the daemon isn't working
|
||||||
|
'pidfile' => '/tmp/friendica.pid',
|
||||||
|
|
||||||
|
'logfile' => '/var/www/html/friendica.log',
|
||||||
|
'loglevel' => 'notice',
|
||||||
|
],
|
||||||
|
'storage' => [
|
||||||
|
'filesystem_path' => '/var/www/html/storage',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!empty(getenv('FRIENDICA_NO_VALIDATION'))) {
|
||||||
|
$config['system']['disable_url_validation'] = true;
|
||||||
|
$config['system']['disable_email_validation'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty(getenv('SMTP_DOMAIN'))) {
|
||||||
|
$smtp_from = !empty(getenv('SMTP_FROM')) ? getenv('SMTP_FROM') : 'no-reply';
|
||||||
|
|
||||||
|
$config['config']['sender_email'] = $smtp_from . "@" . getenv('SMTP_DOMAIN');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $config;
|
|
@ -13,17 +13,15 @@ mkdir -p .vscode && cp .devcontainer/launch.json .vscode/launch.json
|
||||||
|
|
||||||
envsubst < $workspaceFolder/.devcontainer/include/my.cnf > /home/vscode/.my.cnf
|
envsubst < $workspaceFolder/.devcontainer/include/my.cnf > /home/vscode/.my.cnf
|
||||||
|
|
||||||
#Make the workspace directory the docroot
|
# Make the workspace directory the docroot
|
||||||
echo ">>> Symlink $DocumentRoot to $workspaceFolder"
|
echo ">>> Symlink $DocumentRoot to $workspaceFolder"
|
||||||
sudo rm -rf $DocumentRoot
|
sudo rm -rf $DocumentRoot
|
||||||
sudo ln -fs $workspaceFolder $DocumentRoot
|
sudo ln -fs $workspaceFolder $DocumentRoot
|
||||||
|
|
||||||
|
# Set proper permissions
|
||||||
|
sudo chown -R $developmentUser:www-data $workspaceFolder
|
||||||
|
sudo chmod -R g=u $workspaceFolder
|
||||||
|
|
||||||
echo 'error_reporting=0' | sudo tee /usr/local/etc/php/conf.d/no-warn.ini
|
echo 'error_reporting=0' | sudo tee /usr/local/etc/php/conf.d/no-warn.ini
|
||||||
|
|
||||||
# create log file
|
|
||||||
mkdir -p log
|
|
||||||
touch log/friendica.log
|
|
||||||
chmod 666 log/friendica.log
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -17,7 +17,15 @@ sudo chmod 644 /etc/ssl/private/friendica.key
|
||||||
sudo chmod 644 /etc/ssl/certs/friendica.crt
|
sudo chmod 644 /etc/ssl/certs/friendica.crt
|
||||||
|
|
||||||
sudo cp /tmp/001-friendica.conf /etc/apache2/sites-available/001-friendica.conf
|
sudo cp /tmp/001-friendica.conf /etc/apache2/sites-available/001-friendica.conf
|
||||||
sudo a2enmod rewrite actions ssl
|
sudo a2enmod rewrite actions ssl 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 ;
|
||||||
|
} | sudo tee /etc/apache2/conf-available/remoteip.conf > /dev/null
|
||||||
|
sudo a2enconf remoteip
|
||||||
|
|
||||||
sudo a2ensite 001-friendica
|
sudo a2ensite 001-friendica
|
||||||
sudo a2dissite 000-default
|
sudo a2dissite 000-default
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ FRIENDICA_PHP_PATH=$(which php)
|
||||||
export FRIENDICA_PHP_PATH
|
export FRIENDICA_PHP_PATH
|
||||||
|
|
||||||
envsubst < $workspaceFolder/.devcontainer/include/autoinstall.config.php > /tmp/autoinstall.config.php
|
envsubst < $workspaceFolder/.devcontainer/include/autoinstall.config.php > /tmp/autoinstall.config.php
|
||||||
|
cp $workspaceFolder/.devcontainer/include/00apcu.config.php $workspaceFolder/config/00apcu.config.php
|
||||||
|
cp $workspaceFolder/.devcontainer/include/01redis.config.php $workspaceFolder/config/01redis.config.php
|
||||||
|
cp $workspaceFolder/.devcontainer/include/zz-docker.config.php $workspaceFolder/config/zz-docker.config.php
|
||||||
|
|
||||||
|
|
||||||
cd $DocumentRoot
|
cd $DocumentRoot
|
||||||
|
@ -30,4 +33,11 @@ bin/console user password "$ADMIN_NICK" "$ADMIN_PASSW"
|
||||||
bin/console user add "$USER_NICK" "$USER_NICK" "$USER_NICK@$ServerAlias" en http://friendica.local/profile/$USER_NICK
|
bin/console user add "$USER_NICK" "$USER_NICK" "$USER_NICK@$ServerAlias" en http://friendica.local/profile/$USER_NICK
|
||||||
bin/console user password "$USER_NICK" "$USER_PASSW"
|
bin/console user password "$USER_NICK" "$USER_PASSW"
|
||||||
|
|
||||||
|
# create log file
|
||||||
|
#mkdir -p $workspaceFolder/log
|
||||||
|
#touch $workspaceFolder/log/friendica.log
|
||||||
|
#chmod 666 $workspaceFolder/log/friendica.log
|
||||||
|
touch $workspaceFolder/friendica.log
|
||||||
|
chmod 666 $workspaceFolder/friendica.log
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue