Last active
April 8, 2024 13:47
-
-
Save dinamic/60a573e6ffa8749f94931a4d7cfcfcb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:8.3-bookworm | |
RUN apt update -q \ | |
&& apt upgrade -y \ | |
&& apt-get install -y build-essential git libnode-dev | |
RUN mkdir -p /opt/v8 \ | |
&& ln -s /usr/include/node /opt/v8/include \ | |
&& ln -s /usr/lib/$(uname -m)-linux-gnu /opt/v8/lib | |
WORKDIR /tmp | |
RUN git clone https://github.com/phpv8/v8js.git | |
WORKDIR /tmp/v8js | |
RUN phpize \ | |
&& ./configure --with-v8js=/opt/v8 LDFLAGS="-lstdc++" \ | |
&& make \ | |
&& make test \ | |
&& cp -v /tmp/v8js/modules/v8js.* `php -r "echo ini_get('extension_dir');"` \ | |
&& docker-php-ext-enable v8js \ | |
&& rm -rf /tmp/v8js | |
WORKDIR /var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment