openswoole-postgres.dockerfile 657 B

12345678910111213141516171819202122
  1. FROM php:8.1-cli
  2. RUN docker-php-ext-install opcache > /dev/null
  3. ENV SWOOLE_VERSION 4.8.0
  4. RUN apt-get update && apt-get install -y libpq-dev \
  5. && cd /tmp && curl -sSL "https://github.com/openswoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - \
  6. && cd swoole-src-${SWOOLE_VERSION} \
  7. && phpize && ./configure --with-postgres > /dev/null && make > /dev/null && make install > /dev/null \
  8. && docker-php-ext-enable openswoole
  9. WORKDIR /openswoole
  10. COPY swoole-server.php swoole-server.php
  11. RUN sed -i "s|_postgres||g" swoole-server.php
  12. COPY php.ini /usr/local/etc/php/
  13. EXPOSE 8080
  14. CMD php swoole-server.php