Skip to content

Commit

Permalink
Add Dockerfile for alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed May 31, 2024
1 parent d85e241 commit a1e14d3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM php:8.2.13-cli-alpine

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add python3
RUN apk add autoconf gcc g++ make python3-dev

WORKDIR /work
COPY . /work/phpy

RUN docker-php-source extract && \
cd /work/phpy && phpize && \
./configure --with-python-config=/usr/bin/python3-config && \
make clean && make -j $(nproc)

FROM php:8.2.13-cli-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add python3 bash

COPY --from=0 /work/phpy/modules/phpy.so /tmp
RUN cp /tmp/phpy.so $(php-config --extension-dir) && \
docker-php-ext-enable phpy && \
docker-php-source delete
RUN php --ri phpy

CMD ["bash"]

0 comments on commit a1e14d3

Please sign in to comment.