tpotce/docker/glastopf/Dockerfile

72 lines
2 KiB
Text
Raw Normal View History

2018-03-25 18:35:32 +00:00
FROM alpine
# Include dist
ADD dist/ /root/dist/
# Install packages
2018-05-17 17:38:09 +00:00
RUN apk -U --no-cache add \
autoconf \
2018-03-25 18:35:32 +00:00
bind-tools \
build-base \
cython \
git \
libffi \
libffi-dev \
2018-04-26 15:18:23 +00:00
libcap \
2018-09-04 15:28:46 +00:00
libxslt-dev \
2018-03-25 18:35:32 +00:00
make \
2018-09-04 15:28:46 +00:00
php7 \
php7-dev \
2018-03-25 18:35:32 +00:00
py-mysqldb \
py-openssl \
py-pip \
py-setuptools \
python \
python-dev && \
2018-04-26 15:18:23 +00:00
pip install --no-cache-dir --upgrade pip && \
# Install php sandbox from git
2018-06-07 12:38:46 +00:00
git clone --depth=1 https://github.com/mushorg/BFR /opt/BFR && \
cd /opt/BFR && \
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 && \
# Install glastopf from git
2018-06-07 12:38:46 +00:00
git clone --depth=1 https://github.com/mushorg/glastopf.git /opt/glastopf && \
cd /opt/glastopf && \
2018-09-04 15:28:46 +00:00
cp /root/dist/requirements.txt . && \
2018-04-26 15:18:23 +00:00
pip install --no-cache-dir . && \
cd / && \
rm -rf /opt/glastopf /tmp/* /var/tmp/* && \
2018-04-26 15:18:23 +00:00
setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \
# Setup user, groups and configs
addgroup -g 2000 glastopf && \
adduser -S -H -u 2000 -D -g 2000 glastopf && \
2018-05-17 17:38:09 +00:00
mkdir -p /etc/glastopf && \
mv /root/dist/glastopf.cfg /etc/glastopf/ && \
# Clean up
2018-05-17 17:38:09 +00:00
apk del --purge autoconf \
build-base \
file \
git \
libffi-dev \
php7-dev \
python-dev \
2018-09-04 15:28:46 +00:00
py-pip && \
rm -rf /root/* && \
rm -rf /var/cache/apk/*
# Set workdir and start glastopf
2018-09-04 20:51:41 +00:00
USER glastopf:glastopf
2018-03-31 21:44:11 +00:00
WORKDIR /tmp/glastopf/
2018-05-17 17:38:09 +00:00
CMD cp /etc/glastopf/glastopf.cfg /tmp/glastopf && exec glastopf-runner