mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
145 lines
5.0 KiB
Docker
145 lines
5.0 KiB
Docker
FROM debian:bookworm-slim
|
|
|
|
ENV DEB_RELEASE=bookworm
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV PHP_VER=8.4
|
|
ENV NODE_VERSION=20
|
|
# commit of composer 2.8.8
|
|
ENV COMPOSER_COMMIT=f3108f64b4e1c1ce6eb462b159956461592b3e3e
|
|
|
|
# Uncomment to skip the chromium download when installing puppeteer. If you do,
|
|
# you'll need to launch puppeteer with:
|
|
# browser.launch({executablePath: 'google-chrome-unstable'})
|
|
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
|
|
|
WORKDIR /var/www
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
apt-transport-https \
|
|
build-essential \
|
|
ca-certificates \
|
|
curl \
|
|
gnupg2 \
|
|
&& mkdir -p /etc/apt/keyrings \
|
|
&& curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/keyrings/debsuryorg-archive-keyring.gpg \
|
|
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
|
&& echo "deb [signed-by=/etc/apt/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ bookworm main" | tee /etc/apt/sources.list.d/php.list \
|
|
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
cron \
|
|
git \
|
|
make \
|
|
nginx \
|
|
netcat-openbsd \
|
|
nodejs \
|
|
php${PHP_VER}-cli \
|
|
php${PHP_VER}-common \
|
|
php${PHP_VER}-curl \
|
|
php${PHP_VER}-fpm \
|
|
php${PHP_VER}-gd \
|
|
php${PHP_VER}-iconv \
|
|
php${PHP_VER}-mbstring \
|
|
php${PHP_VER}-memcached \
|
|
php${PHP_VER}-mysql \
|
|
php${PHP_VER}-pgsql \
|
|
php${PHP_VER}-xml \
|
|
php${PHP_VER}-zip \
|
|
php${PHP_VER}-apcu \
|
|
php${PHP_VER}-dev \
|
|
php${PHP_VER}-bcmath \
|
|
php${PHP_VER}-gmp \
|
|
php-xdebug \
|
|
python3 \
|
|
python3-pip \
|
|
python3-setuptools \
|
|
python3-wheel \
|
|
shellcheck \
|
|
software-properties-common \
|
|
unzip \
|
|
zlib1g-dev \
|
|
# Puppeteer layer
|
|
# This installs the necessary packages to run the bundled version of chromium for puppeteer
|
|
gconf-service \
|
|
libasound2 \
|
|
libatk1.0-0 \
|
|
libc6 \
|
|
libcairo2 \
|
|
libcups2 \
|
|
libdbus-1-3 \
|
|
libdrm2 \
|
|
libexpat1 \
|
|
libfontconfig1 \
|
|
libgbm1 \
|
|
libgcc1 \
|
|
libgconf-2-4 \
|
|
libgdk-pixbuf2.0-0 \
|
|
libglib2.0-0 \
|
|
libgtk-3-0 \
|
|
libnspr4 \
|
|
libpango-1.0-0 \
|
|
libpangocairo-1.0-0 \
|
|
libstdc++6 \
|
|
libx11-6 \
|
|
libx11-xcb1 \
|
|
libxcb1 \
|
|
libxcomposite1 \
|
|
libxcursor1 \
|
|
libxdamage1 \
|
|
libxext6 \
|
|
libxfixes3 \
|
|
libxi6 \
|
|
libxrandr2 \
|
|
libxrender1 \
|
|
libxss1 \
|
|
libxtst6 \
|
|
fonts-liberation \
|
|
libnss3 \
|
|
lsb-release \
|
|
xdg-utils \
|
|
# cypress
|
|
# all below is needed until running cypress headless/electron-less is fixed: https://github.com/cypress-io/cypress/issues/23636
|
|
libgbm-dev \
|
|
libgtk2.0-0 \
|
|
libnotify-dev \
|
|
procps \
|
|
xvfb \
|
|
&& apt-get autoremove \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& curl -fsSL https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_COMMIT/web/installer \
|
|
| php -- --quiet \
|
|
&& mv composer.phar /usr/local/bin/composer \
|
|
# Python tools layer
|
|
&& pip3 install --break-system-packages chardet eac-logchecker xld-logchecker
|
|
|
|
COPY misc/docker/ /var/www/misc/docker
|
|
COPY lib /var/www/lib
|
|
COPY bin/ /var/www/bin
|
|
|
|
# Permissions and configuration layer
|
|
RUN useradd -ms /bin/bash gazelle \
|
|
&& cp /var/www/misc/docker/web/php.ini /etc/php/${PHP_VER}/cli/php.ini \
|
|
&& cp /var/www/misc/docker/web/php.ini /etc/php/${PHP_VER}/fpm/php.ini \
|
|
&& cp /var/www/misc/docker/web/xdebug.ini /etc/php/${PHP_VER}/mods-available/xdebug.ini \
|
|
&& cp /var/www/misc/docker/web/www.conf /etc/php/${PHP_VER}/fpm/pool.d/www.conf \
|
|
&& cp /var/www/misc/docker/web/nginx.conf /etc/nginx/sites-available/gazelle.conf \
|
|
&& ln -s /etc/nginx/sites-available/gazelle.conf /etc/nginx/sites-enabled/gazelle.conf \
|
|
&& rm -f /etc/nginx/sites-enabled/default \
|
|
&& echo "Initialize Boris..." \
|
|
&& grep '^disable_functions' /etc/php/${PHP_VER}/cli/php.ini \
|
|
| sed -r 's/pcntl_(fork|signal|signal_dispatch|waitpid),//g' \
|
|
> /etc/php/${PHP_VER}/cli/conf.d/99-boris.ini \
|
|
&& echo "Generate file storage directories..." \
|
|
&& perl /var/www/bin/generate-storage-dirs /var/lib/gazelle/torrent 2 100 \
|
|
&& perl /var/www/bin/generate-storage-dirs /var/lib/gazelle/riplog 2 100 \
|
|
&& perl /var/www/bin/generate-storage-dirs /var/lib/gazelle/riploghtml 2 100 \
|
|
&& chown -R gazelle:gazelle /var/lib/gazelle /var/www
|
|
|
|
EXPOSE 80/tcp
|
|
EXPOSE 3306/tcp
|
|
EXPOSE 34000/tcp
|
|
|
|
ENTRYPOINT [ "/bin/bash", "/var/www/misc/docker/web/entrypoint.sh" ]
|