wallabag/docker/php/Dockerfile

99 lines
2.4 KiB
Docker
Raw Normal View History

FROM php:8.1-fpm AS rootless
2016-01-09 14:47:32 +01:00
ARG DEBIAN_FRONTEND=noninteractive
ARG NODE_VERSION=20
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-01-09 14:47:32 +01:00
RUN apt-get update && apt-get install -y \
libmcrypt-dev \
libicu-dev \
libpq-dev \
libxml2-dev \
libpng-dev \
libjpeg-dev \
libwebp-dev \
libsqlite3-dev \
imagemagick \
libmagickwand-dev \
libtidy-dev \
libonig-dev \
libzip-dev \
libfreetype6-dev \
zlib1g-dev \
git \
build-essential \
nodejs
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
RUN docker-php-ext-install -j "$(nproc)" \
bcmath \
gd \
gettext \
iconv \
intl \
mbstring \
opcache \
pdo \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
sockets \
tidy \
zip
RUN pecl install redis; \
pecl install imagick; \
pecl install xdebug-3.1.6; \
docker-php-ext-enable \
redis \
imagick \
xdebug \
;
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 23:46:49 +02:00
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
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 06:47:58 +02:00
/var/www/html/data/db \
/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 14:47:32 +01:00
ARG USER_UID=1000
ARG USER_GID=1000
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 14:47:32 +01:00
USER www-data