tpotce/docker/tanner/phpox/Dockerfile

49 lines
1.3 KiB
Text
Raw Normal View History

FROM alpine:3.15
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install packages
2021-02-19 13:02:08 +00:00
RUN apk -U --no-cache add \
2018-05-26 23:09:31 +00:00
build-base \
file \
git \
make \
php7 \
php7-dev \
py3-pip \
2018-05-26 23:09:31 +00:00
python3 \
python3-dev \
re2c && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install bfr sandbox from git
2020-09-04 12:37:28 +00:00
git clone https://github.com/mushorg/BFR /opt/BFR && \
2018-05-26 23:09:31 +00:00
cd /opt/BFR && \
2021-09-24 15:18:59 +00:00
# git checkout 508729202428a35bcc6bb27dd97b831f7e5009b5 && \
2018-05-26 23:09:31 +00:00
phpize7 && \
./configure \
--with-php-config=/usr/bin/php-config7 \
--enable-bfr && \
make && \
make install && \
cd / && \
rm -rf /opt/BFR /tmp/* /var/tmp/* && \
echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php7/php.ini && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install PHP Sandbox
2020-09-04 12:37:28 +00:00
git clone https://github.com/mushorg/phpox /opt/phpox && \
2018-05-26 23:09:31 +00:00
cd /opt/phpox && \
2021-09-24 15:18:59 +00:00
git checkout a62c8136ec7b3ebab0c989f4235e2960175121f8 && \
2018-05-26 23:09:31 +00:00
pip3 install -r requirements.txt && \
make && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Clean up
apk del --purge build-base \
git \
php7-dev \
python3-dev && \
2022-03-08 23:36:03 +00:00
rm -rf /root/* /var/cache/apk/* /opt/phpox/.git
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Set workdir and start phpsandbox
2018-09-11 12:19:26 +00:00
STOPSIGNAL SIGKILL
2018-05-28 16:36:02 +00:00
USER nobody:nobody
2018-05-26 23:09:31 +00:00
WORKDIR /opt/phpox
2019-08-16 16:55:36 +00:00
CMD ["python3", "sandbox.py"]