pull/161/head
Pavel Loginov 2019-09-27 22:25:22 +03:00
parent 2aecbd1534
commit 9f1717c355
1 changed files with 37 additions and 5 deletions

View File

@ -10,6 +10,10 @@ ENV MYSQL_PASS "haproxy-wi"
ENV MYSQL_DB "haproxywi2"
ENV MYSQL_HOST 127.0.0.1
# Copy external files
COPY epel.repo /etc/yum.repos.d/epel.repo
COPY haproxy-wi.conf /etc/httpd/conf.d/haproxy-wi.conf
# Yum clean cache
RUN yum remove epel-release && \
rm -rf /var/lib/rpm/__db* && \
@ -17,10 +21,25 @@ RUN yum remove epel-release && \
# Yum install base packages
RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm && \
yum install -y yum install https://repo.haproxy-wi.org/el7/haproxy-wi-release-7-1-0.noarch.rpm && \
yum install -y epel-release && \
yum -y install \
haproxy-wi && \
git \
nmap-ncat \
net-tools \
python35u \
python35u-pip \
python35u-devel \
python34-devel \
dos2unix \
httpd \
gcc-c++ \
gcc \
gcc-gfortran \
yum-plugin-remove-with-leaves \
openldap-devel \
mod_ssl
# Clone haproxy-wi git repo
RUN git clone https://github.com/Aidaho12/haproxy-wi.git /var/www/haproxy-wi && \
sed -i "s/enable = 0/enable = $MYSQL_ENABLE/g" /var/www/haproxy-wi/app/haproxy-wi.cfg && \
sed -i "s/mysql_user = haproxy-wi/mysql_user = $MYSQL_USER/g" /var/www/haproxy-wi/app/haproxy-wi.cfg && \
sed -i "s/mysql_password = haproxy-wi/mysql_password = $MYSQL_PASS/g" /var/www/haproxy-wi/app/haproxy-wi.cfg && \
@ -28,8 +47,21 @@ RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm && \
sed -i "s/mysql_host = 127.0.0.1/mysql_host = $MYSQL_HOST/g" /var/www/haproxy-wi/app/haproxy-wi.cfg && \
mkdir /var/www/haproxy-wi/keys/ && \
mkdir -p /var/www/haproxy-wi/configs/hap_config && \
chown -R apache:apache /var/www/haproxy-wi/ && \
yum -y erase \
chown -R apache:apache /var/www/haproxy-wi/
# PIP Install deps
RUN pip3.5 install -r /var/www/haproxy-wi/requirements.txt --no-cache-dir
# Fix app haproxy-wi perms
RUN chmod +x /var/www/haproxy-wi/app/*.py && \
chmod +x /var/www/haproxy-wi/app/tools/*.py && \
chown -R apache:apache /var/log/httpd/
RUN chown -R apache:apache /var/www/haproxy-wi
# Yum clear container
RUN yum -y erase \
git \
python35u-pip \
gcc-c++ \