-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
53 lines (44 loc) · 1.16 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use Ubuntu as base image
FROM ubuntu:24.04
# Avoid timezone prompt during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install basic build requirements
RUN apt-get update && apt-get install -y \
git \
curl \
build-essential \
bison \
re2c \
llvm \
clang \
libclang-dev \
php-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
# WORKDIR /build
# Clone PHP source code
# RUN git clone https://github.com/php/php-src.git \
# && cd php-src \
# && git checkout PHP-8.3
# Build PHP from source
# RUN cd php-src \
# && ./buildconf \
# && ./configure --prefix=/usr/local/php \
# --enable-debug \
# --disable-all \
# --disable-cgi \
# && make -j$(nproc) \
# && make install
# Copy source code
COPY . /usr/src/typ-php
# Download and install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Build extension
WORKDIR /usr/src/typ-php/php-typ
ENV PHP=/usr/bin/php
ENV PHP_CONFIG=/usr/bin/php-config
RUN cargo build
# Run test
WORKDIR /usr/src/typ-php
CMD ["/usr/bin/php", "-d", "extension=./php-typ/target/debug/libtyp_php.so", "./test.php"]