swoole-postgres.dockerfile 928 B

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