openswoole-postgres.dockerfile 816 B

1234567891011121314151617181920212223242526
  1. FROM php:8.2-cli
  2. RUN apt-get update && apt-get install -y git > /dev/null
  3. RUN docker-php-ext-install opcache > /dev/null
  4. ENV VERSION 22.0.0
  5. RUN apt-get update && apt-get install -y libpq-dev \
  6. && cd /tmp && curl -sSL "https://github.com/openswoole/ext-openswoole/archive/v${VERSION}.tar.gz" | tar xzf - \
  7. && cd ext-openswoole-${VERSION} \
  8. && phpize && ./configure --with-postgres > /dev/null && make > /dev/null && make install > /dev/null \
  9. && docker-php-ext-enable openswoole
  10. COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
  11. COPY php.ini /usr/local/etc/php/
  12. ADD ./ /openswoole
  13. WORKDIR /openswoole
  14. RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
  15. EXPOSE 8080
  16. CMD php /openswoole/openswoole-server-postgres.php