Skip to content

Instantly share code, notes, and snippets.

@akccakcctw
Forked from dinamic/php-v8js.Dockerfile
Created September 30, 2024 13:36
Show Gist options
  • Select an option

  • Save akccakcctw/ec2a83e8b82fcdeee533836232396faa to your computer and use it in GitHub Desktop.

Select an option

Save akccakcctw/ec2a83e8b82fcdeee533836232396faa 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment