2023-07-22 17:16:32 +00:00
|
|
|
FROM php:8.1-fpm AS rootless
|
2016-01-09 13:47:32 +00:00
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2023-12-27 22:00:49 +00:00
|
|
|
ARG NODE_VERSION=20
|
2022-03-12 18:37:47 +00:00
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg \
|
|
|
|
lsb-release \
|
|
|
|
openssl \
|
|
|
|
software-properties-common
|
|
|
|
|
|
|
|
RUN curl 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key' | apt-key add - \
|
|
|
|
&& echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list
|
2016-03-02 12:31:53 +00:00
|
|
|
|
2016-01-09 13:47:32 +00:00
|
|
|
RUN apt-get update && apt-get install -y \
|
2019-06-19 12:54:38 +00:00
|
|
|
libmcrypt-dev \
|
|
|
|
libicu-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libjpeg-dev \
|
2022-05-03 05:06:15 +00:00
|
|
|
libwebp-dev \
|
2019-06-19 12:54:38 +00:00
|
|
|
libsqlite3-dev \
|
|
|
|
imagemagick \
|
2019-07-06 20:03:40 +00:00
|
|
|
libmagickwand-dev \
|
2019-10-27 18:04:04 +00:00
|
|
|
libtidy-dev \
|
2022-03-12 18:37:47 +00:00
|
|
|
libonig-dev \
|
|
|
|
libzip-dev \
|
|
|
|
libfreetype6-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
git \
|
|
|
|
build-essential \
|
2023-12-27 22:00:49 +00:00
|
|
|
nodejs
|
2022-05-03 05:06:15 +00:00
|
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
2022-03-12 18:37:47 +00:00
|
|
|
RUN docker-php-ext-install -j "$(nproc)" \
|
|
|
|
bcmath \
|
2019-10-27 18:04:04 +00:00
|
|
|
gd \
|
2022-03-12 18:37:47 +00:00
|
|
|
gettext \
|
|
|
|
iconv \
|
2019-06-19 12:54:38 +00:00
|
|
|
intl \
|
2022-03-12 18:37:47 +00:00
|
|
|
mbstring \
|
|
|
|
opcache \
|
2019-06-19 12:54:38 +00:00
|
|
|
pdo \
|
|
|
|
pdo_mysql \
|
|
|
|
pdo_pgsql \
|
2019-07-06 20:03:40 +00:00
|
|
|
pdo_sqlite \
|
2019-10-27 18:04:04 +00:00
|
|
|
sockets \
|
|
|
|
tidy \
|
|
|
|
zip
|
2019-06-19 12:54:38 +00:00
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
RUN pecl install redis; \
|
|
|
|
pecl install imagick; \
|
2022-12-22 11:30:34 +00:00
|
|
|
pecl install xdebug-3.1.6; \
|
2022-03-12 18:37:47 +00:00
|
|
|
docker-php-ext-enable \
|
|
|
|
redis \
|
|
|
|
imagick \
|
|
|
|
xdebug \
|
|
|
|
;
|
|
|
|
|
2024-02-24 00:18:08 +00:00
|
|
|
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
|
|
|
|
&& architecture=$(uname -m) \
|
|
|
|
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
|
|
|
|
&& mkdir -p /tmp/blackfire \
|
|
|
|
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
|
|
|
|
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
|
|
|
|
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
|
|
|
|
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
|
|
|
|
|
|
|
|
RUN mkdir -p /tmp/blackfire \
|
|
|
|
&& architecture=$(uname -m) \
|
|
|
|
&& curl -A "Docker" -L https://blackfire.io/api/v1/releases/cli/linux/$architecture | tar zxp -C /tmp/blackfire \
|
|
|
|
&& mv /tmp/blackfire/blackfire /usr/bin/blackfire \
|
|
|
|
&& rm -Rf /tmp/blackfire
|
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
RUN npm install -g yarn
|
|
|
|
|
|
|
|
RUN curl -L -o /usr/local/bin/envsubst https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m`; \
|
|
|
|
chmod +x /usr/local/bin/envsubst
|
|
|
|
|
2022-05-21 21:46:49 +00:00
|
|
|
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
2022-03-12 18:37:47 +00:00
|
|
|
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
|
|
COPY config/ /opt/wallabag/config/
|
|
|
|
|
|
|
|
RUN mkdir -p \
|
|
|
|
/var/www/html/app/config/ \
|
|
|
|
/var/www/html/var/cache \
|
|
|
|
/var/www/html/web/assets \
|
|
|
|
/var/www/html/data \
|
2022-05-03 04:47:58 +00:00
|
|
|
/var/www/html/data/db \
|
2022-03-12 18:37:47 +00:00
|
|
|
/var/www/.cache
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
CMD ["php", "bin/console", "--env=dev", "server:run", "0.0.0.0:8000"]
|
|
|
|
|
|
|
|
FROM rootless AS default
|
2016-01-09 13:47:32 +00:00
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
ARG USER_UID=1000
|
|
|
|
ARG USER_GID=1000
|
2016-02-25 20:56:33 +00:00
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
RUN groupmod -g 1000 www-data ; \
|
|
|
|
usermod -u ${USER_UID} -g www-data www-data ; \
|
|
|
|
touch /usr/local/etc/php/conf.d/wallabag-php.ini \
|
|
|
|
/var/www/.yarnrc ; \
|
|
|
|
chown -R www-data: /var/www/html \
|
|
|
|
/usr/local/etc/php/conf.d/wallabag-php.ini \
|
|
|
|
/var/www/.cache \
|
|
|
|
/var/www/.yarnrc
|
2016-01-09 13:47:32 +00:00
|
|
|
|
2022-03-12 18:37:47 +00:00
|
|
|
USER www-data
|