ubiquity.dockerfile 1016 B

123456789101112131415161718192021222324252627282930
  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
  5. RUN apt-get update -yqq > /dev/null && \
  6. apt-get install -yqq nginx git unzip php8.1 php8.1-common php8.1-cli php8.1-fpm php8.1-mysql php8.1-dev > /dev/null
  7. COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
  8. COPY deploy/conf/* /etc/php/8.1/fpm/
  9. ADD ./ /ubiquity
  10. WORKDIR /ubiquity
  11. RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.1/fpm/php-fpm.conf ; fi;
  12. RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
  13. RUN chmod 777 -R /ubiquity/app/cache/*
  14. COPY deploy/conf/ubiquity-config.php app/config/config.php
  15. RUN echo "opcache.preload=/ubiquity/app/config/preloader.script.php" >> /etc/php/8.1/fpm/php.ini
  16. EXPOSE 8080
  17. CMD service php8.1-fpm start && \
  18. nginx -c /ubiquity/deploy/nginx.conf -g "daemon off;"