ubiquity-ngx-micro.dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev \
  8. php8.0-cli php8.0-dev php8.0-mbstring libphp8.0-embed nginx > /dev/null
  9. COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
  10. ADD ./ ./
  11. ENV NGINX_VERSION=1.21.0
  12. RUN git clone -b v0.0.25 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
  13. RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
  14. tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
  15. cd nginx-${NGINX_VERSION} && \
  16. export PHP_LIB=/usr/lib && \
  17. bash ./configure --user=www --group=www \
  18. --prefix=/nginx \
  19. --with-ld-opt="-Wl,-rpath,$PHP_LIB" \
  20. --add-module=/ngx_php7/third_party/ngx_devel_kit \
  21. --add-module=/ngx_php7 > /dev/null && \
  22. make > /dev/null && make install > /dev/null
  23. ADD ./ /ubiquity
  24. WORKDIR /ubiquity
  25. RUN composer require phpmv/ubiquity-ngx:dev-master --quiet
  26. RUN chmod 777 -R app/cache/*
  27. COPY deploy/conf/ngx/services-micro.php app/config/ngxServices.php
  28. RUN composer require phpmv/ubiquity-devtools:dev-master --quiet
  29. RUN /ubiquity/vendor/bin/Ubiquity bootstrap prod
  30. RUN echo "opcache.preload=/ubiquity/app/config/preloader.script.php" >> deploy/conf/php.ini
  31. RUN echo "opcache.jit_buffer_size=128M\nopcache.jit=tracing\n" >> deploy/conf/php.ini
  32. RUN export WORKERS=$(( $(nproc) )) && \
  33. sed -i "s|worker_processes auto|worker_processes $WORKERS|g" /ubiquity/deploy/conf/ngx/nginx.conf
  34. EXPOSE 8080
  35. CMD /nginx/sbin/nginx -c /ubiquity/deploy/conf/ngx/nginx.conf