Skip to content

Instantly share code, notes, and snippets.

@dinamic
Last active September 30, 2024 13:37
Show Gist options
  • Save dinamic/60a573e6ffa8749f94931a4d7cfcfcb8 to your computer and use it in GitHub Desktop.
Save dinamic/60a573e6ffa8749f94931a4d7cfcfcb8 to your computer and use it in GitHub Desktop.
FROM php:8.3-bookworm
RUN apt update -q && apt upgrade -y \
&& apt-get install -y build-essential git libnode-dev
RUN cp -s /usr/lib/`uname -m`-linux-gnu/libv8* /usr/local/lib/ \
&& cp -rs /usr/include/node/* /usr/local/include/
# TODO: Use PECL
WORKDIR /tmp
RUN git clone https://github.com/phpv8/v8js.git --branch php8
WORKDIR /tmp/v8js
RUN phpize && ./configure && make && make test \
&& cp -v modules/v8js.* `php -r "echo ini_get('extension_dir');"` \
&& docker-php-ext-enable v8js \
&& rm -rf /tmp/v8js \
&& php --ri v8js
WORKDIR /var/www/html
@akccakcctw
Copy link

thanks, it works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment