lumen-swoole.dockerfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM php:8.3-cli
  2. RUN pecl install swoole > /dev/null && \
  3. docker-php-ext-enable swoole
  4. RUN docker-php-ext-install pdo_mysql > /dev/null
  5. ADD ./ /lumen
  6. WORKDIR /lumen
  7. COPY deploy/swoole/php.ini /usr/local/etc/php/
  8. RUN mkdir -p /lumen/storage/framework/sessions
  9. RUN mkdir -p /lumen/storage/framework/views
  10. RUN mkdir -p /lumen/storage/framework/cache
  11. RUN chmod -R 777 /lumen
  12. # Install composer using the installation method documented at https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
  13. # This method was chosen because composer is not part of the apt repositories that are in the default PHP 7.2 docker image
  14. # Adding alternate apt php repos can potentially cause problems with extension compatibility between the php build from the docker image and the alternate php build
  15. # An additional benefit of this method is that the correct version of composer will be used for the environment and version of the php system in the docker image
  16. RUN deploy/swoole/install-composer.sh
  17. RUN apt-get update -yqq > /dev/null && \
  18. apt-get install -yqq git unzip > /dev/null
  19. COPY deploy/swoole/composer* ./
  20. RUN php composer.phar install --optimize-autoloader --classmap-authoritative --no-dev --quiet
  21. RUN echo "APP_SWOOLE=true" >> .env
  22. RUN chmod -R 777 /lumen
  23. EXPOSE 8080
  24. CMD php artisan swoole:http start