Skip to content

Commit

Permalink
Add support for pgsql (brefphp#13)
Browse files Browse the repository at this point in the history
* Add pgsql layer

* Update README

* Change the order to alphabetical
  • Loading branch information
sabmeua authored and Nyholm committed Jan 27, 2020
1 parent c5db92c commit 04e5dac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
- LAYER=blackfire PHP="72 73 74"
- LAYER=gmp PHP="72 73 74"
- LAYER=memcached PHP="72 73 74"
- LAYER=pgsql PHP="72 73 74"
- LAYER=xdebug PHP="72 73 74"

before_install:
Expand Down
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extension=/opt/bref-extra/amqp.so
| GMP | `${bref:extra.gmp-php-74}` | `extension=/opt/bref-extra/gmp.so` |
| Memcache | `${bref:extra.memcached-php-74}` | `extension=/opt/bref-extra/memcache.so` |
| Memcached | `${bref:extra.memcached-php-74}` | `extension=/opt/bref-extra/memcached.so` |
| PostgreSQL | `${bref:extra.pgsql-php-74}` | `extension=/opt/bref-extra/pgsql.so` |
| Xdebug | `${bref:extra.xdebug-php-74}` | `zend_extension=/opt/bref-extra/xdebug.so` |

Note that the "Memcached" layer provides both extension for [Memcache](https://pecl.php.net/package/memcache) and [Memcached](https://pecl.php.net/package/memcached).
Expand Down
15 changes: 15 additions & 0 deletions layers/pgsql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG PHP_VERSION
FROM bref/build-php-$PHP_VERSION AS ext

WORKDIR ${PHP_BUILD_DIR}/ext/pgsql
RUN phpize
RUN ./configure --with-pgsql=${INSTALL_DIR}
RUN make -j `nproc` && make install

RUN cp `php-config --extension-dir`/pgsql.so /tmp/pgsql.so

# Build the final image from the lambci image that is close to the production environment
FROM lambci/lambda:provided

# Copy things we installed to the final image
COPY --from=ext /tmp/pgsql.so /opt/bref-extra/pgsql.so

0 comments on commit 04e5dac

Please sign in to comment.