ubiquity-ngx-raw.dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM ubuntu:20.04
  2. ARG DEBIAN_FRONTEND=noninteractive
  3. RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
  4. RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
  5. RUN apt-get update -yqq > /dev/null && \
  6. apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
  7. zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
  8. php7.4 php7.4-common php7.4-dev libphp7.4-embed php7.4-pgsql nginx > /dev/null
  9. ADD ./ ./
  10. ENV NGINX_VERSION=1.19.2
  11. RUN git clone -b v0.0.24 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
  12. RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
  13. tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
  14. cd nginx-${NGINX_VERSION} && \
  15. export PHP_LIB=/usr/lib && \
  16. ./configure --user=www-data --group=www-data \
  17. --prefix=/nginx \
  18. --with-ld-opt="-Wl,-rpath,$PHP_LIB" \
  19. --add-module=/ngx_php7/third_party/ngx_devel_kit \
  20. --add-module=/ngx_php7 > /dev/null && \
  21. make > /dev/null && make install > /dev/null
  22. RUN apt-get install -yqq composer > /dev/null
  23. RUN composer config -g repo.packagist composer https://packagist.phpcomposer.com
  24. RUN composer require phpmv/ubiquity-ngx:dev-master --quiet
  25. RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
  26. RUN chmod 777 -R app/cache/*
  27. COPY /deploy/conf/ngx/pgsql/raw/ngxServices.php /app/config/ngxServices.php
  28. RUN echo "opcache.preload=/app/config/preloader.script.php" >> /deploy/conf/php.ini
  29. RUN export WORKERS=$(( 4 * $(nproc) )) && \
  30. sed -i "s|worker_processes auto|worker_processes $WORKERS|g" /deploy/conf/ngx/nginx.conf
  31. CMD /nginx/sbin/nginx -c /deploy/conf/ngx/nginx.conf