<commit_before>#FROM ubuntu
FROM debian:wheezy
 
RUN apt-get update

#Utilities
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget less curl git nmap socat netcat tree htop unzip sudo

RUN wget -O- --quiet https://bootstrap.saltstack.com | \
    sudo sh -s -- -g https://github.com/saltstack/salt.git git v2014.7.0rc2 || true

#Docker client only
RUN wget -O /usr/local/bin/docker https://get.docker.io/builds/Linux/x86_64/docker-latest && \
    chmod +x /usr/local/bin/docker


#Preseed local master-minion
RUN cd /tmp && \
    salt-key --gen-keys=master-minion && \
    mkdir -p /etc/salt/pki/master/minions && \
    cp master-minion.pub /etc/salt/pki/master/minions/master-minion && \
    mkdir -p /etc/salt/pki/minion && \
    cp master-minion.pub /etc/salt/pki/minion/minion.pub && \
    cp master-minion.pem /etc/salt/pki/minion/minion.pem

RUN echo "file_client: local\nmaster: localhost" > /etc/salt/minion

#######
# Salt Configuration
#######

ADD ./pillar /srv/pillar/
ADD ./salt/koha/files /srv/salt/koha/files

ADD ./salt/common/init.sls /srv/salt/common/init.sls
RUN salt-call --local state.sls common

ADD ./salt/koha/init.sls /srv/salt/koha/init.sls
RUN salt-call --local state.sls koha

ADD ./salt/koha/apache2.sls /srv/salt/koha/apache2.sls
ADD ./salt/koha/files/apache.tmpl /srv/salt/koha/files/apache.tmpl
RUN salt-call --local state.sls koha.apache2

ADD ./salt/koha/common.sls /srv/salt/koha/common.sls
ADD ./salt/koha/files/koha-common.cnf /srv/salt/koha/files/koha-common.cnf
ADD ./salt/koha/files/koha-conf.xml.tmpl /srv/salt/koha/files/koha-conf.xml.tmpl
ADD ./salt/koha/files/zebra.passwd.tmpl /srv/salt/koha/files/zebra.passwd.tmpl
RUN salt-call --local state.sls koha.common

ADD ./salt/koha/sites-config.sls /srv/salt/koha/sites-config.sls
ADD ./salt/koha/files/koha-sites.conf /srv/salt/koha/files/koha-sites.conf
ADD ./salt/koha/files/passwd /srv/salt/koha/files/passwd
RUN salt-call --local state.sls koha.sites-config

ADD ./salt/mysql/server.sls /srv/salt/mysql/server.sls
RUN salt-call --local state.sls mysql.server

ADD ./salt/koha/createdb.sls /srv/salt/koha/createdb.sls
RUN /etc/init.d/mysql start && \
    salt-call --local state.sls koha.createdb && \
    /etc/init.d/mysql stop && \
    sleep 10   

ADD ./salt/koha/config.sls /srv/salt/koha/config.sls
RUN salt-call --local state.sls koha.config

ADD ./salt/koha/watir.sls /srv/salt/koha/watir.sls
RUN salt-call --local state.sls koha.watir

ADD ./salt/koha/webinstaller.sls /srv/salt/koha/webinstaller.sls
ADD ./salt/koha/files/KohaWebInstallAutomation.rb /srv/salt/koha/files/KohaWebInstallAutomation.rb
ADD ./salt/koha/files/updatekohadbversion.sh /srv/salt/koha/files/updatekohadbversion.sh
ADD ./salt/koha/webinstaller.sls /srv/salt/koha/webinstaller.sls
RUN /etc/init.d/mysql start && \
    /etc/init.d/apache2 start && \
    salt-call --local state.sls koha.webinstaller && \
    /etc/init.d/apache2 stop && \
    /etc/init.d/mysql stop && \
    sleep 10  

ADD ./salt/koha/restful.sls /srv/salt/koha/restful.sls
ADD ./salt/koha/files/koha-restful-config.yaml /srv/salt/koha/files/koha-restful-config.yaml
RUN salt-call --local state.sls koha.restful

ENV HOME /root
WORKDIR /root
EXPOSE 80 4506 8080 8081

CMD /etc/init.d/mysql start && /etc/init.d/koha-common start && /usr/sbin/apache2ctl -D FOREGROUND
<commit_msg>Remove stopping mysql in webinstaller step<commit_after>#FROM ubuntu
FROM debian:wheezy
 
RUN apt-get update

#Utilities
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget less curl git nmap socat netcat tree htop unzip sudo

RUN wget -O- --quiet https://bootstrap.saltstack.com | \
    sudo sh -s -- -g https://github.com/saltstack/salt.git git v2014.7.0rc2 || true

#Docker client only
RUN wget -O /usr/local/bin/docker https://get.docker.io/builds/Linux/x86_64/docker-latest && \
    chmod +x /usr/local/bin/docker


#Preseed local master-minion
RUN cd /tmp && \
    salt-key --gen-keys=master-minion && \
    mkdir -p /etc/salt/pki/master/minions && \
    cp master-minion.pub /etc/salt/pki/master/minions/master-minion && \
    mkdir -p /etc/salt/pki/minion && \
    cp master-minion.pub /etc/salt/pki/minion/minion.pub && \
    cp master-minion.pem /etc/salt/pki/minion/minion.pem

RUN echo "file_client: local\nmaster: localhost" > /etc/salt/minion

#######
# Salt Configuration
#######

ADD ./pillar /srv/pillar/
ADD ./salt/koha/files /srv/salt/koha/files

ADD ./salt/common/init.sls /srv/salt/common/init.sls
RUN salt-call --local state.sls common

ADD ./salt/koha/init.sls /srv/salt/koha/init.sls
RUN salt-call --local state.sls koha

ADD ./salt/koha/apache2.sls /srv/salt/koha/apache2.sls
ADD ./salt/koha/files/apache.tmpl /srv/salt/koha/files/apache.tmpl
RUN salt-call --local state.sls koha.apache2

ADD ./salt/koha/common.sls /srv/salt/koha/common.sls
ADD ./salt/koha/files/koha-common.cnf /srv/salt/koha/files/koha-common.cnf
ADD ./salt/koha/files/koha-conf.xml.tmpl /srv/salt/koha/files/koha-conf.xml.tmpl
ADD ./salt/koha/files/zebra.passwd.tmpl /srv/salt/koha/files/zebra.passwd.tmpl
RUN salt-call --local state.sls koha.common

ADD ./salt/koha/sites-config.sls /srv/salt/koha/sites-config.sls
ADD ./salt/koha/files/koha-sites.conf /srv/salt/koha/files/koha-sites.conf
ADD ./salt/koha/files/passwd /srv/salt/koha/files/passwd
RUN salt-call --local state.sls koha.sites-config

ADD ./salt/mysql/server.sls /srv/salt/mysql/server.sls
RUN salt-call --local state.sls mysql.server

ADD ./salt/koha/createdb.sls /srv/salt/koha/createdb.sls
RUN /etc/init.d/mysql start && \
    salt-call --local state.sls koha.createdb && \
    /etc/init.d/mysql stop && \
    sleep 10   

ADD ./salt/koha/config.sls /srv/salt/koha/config.sls
RUN salt-call --local state.sls koha.config

ADD ./salt/koha/watir.sls /srv/salt/koha/watir.sls
RUN salt-call --local state.sls koha.watir

ADD ./salt/koha/webinstaller.sls /srv/salt/koha/webinstaller.sls
ADD ./salt/koha/files/KohaWebInstallAutomation.rb /srv/salt/koha/files/KohaWebInstallAutomation.rb
ADD ./salt/koha/files/updatekohadbversion.sh /srv/salt/koha/files/updatekohadbversion.sh
ADD ./salt/koha/webinstaller.sls /srv/salt/koha/webinstaller.sls
RUN /etc/init.d/mysql start && \
    /etc/init.d/apache2 start && \
    salt-call --local state.sls koha.webinstaller && \
    /etc/init.d/apache2 stop && \
    sleep 10  

ADD ./salt/koha/restful.sls /srv/salt/koha/restful.sls
ADD ./salt/koha/files/koha-restful-config.yaml /srv/salt/koha/files/koha-restful-config.yaml
RUN salt-call --local state.sls koha.restful

ENV HOME /root
WORKDIR /root
EXPOSE 80 4506 8080 8081

CMD /etc/init.d/mysql start && /etc/init.d/koha-common start && /usr/sbin/apache2ctl -D FOREGROUND

{'fraction_non_alphanumeric': 0.15617014880505034, 'fraction_numerical': 0.010521569216894634, 'mean_word_length': 3.069724770642202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6553942', 'n_tokens_mistral': 3025, 'n_tokens_neox': 2720, 'n_words': 477}