swoole-postgres.dockerfile 879 B

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