<commit_before># Copyright (c) 2015, <NAME> <<EMAIL>>

FROM gentoo/stage3-amd64
MAINTAINER <NAME> <<EMAIL>>
LABEL description="Base system to run Trac in a Gentoo environment" \
      copyright="(c) 2015, <NAME> <<EMAIL>>" \
      license="MIT"

RUN echo 'USE="$USE sqlite"' >> /etc/portage/make.conf
RUN echo 'MAKEOPTS="-j2"' >> /etc/portage/make.conf

# Install packages and immediately remove the portage tree to avoid increasing
# the image size too much. The user should mount a volume at this location
# instead to have the portage tree stored locally on the host OS.
RUN emerge-webrsync -q && \
    emerge -q app-portage/eix app-portage/gentoolkit app-editors/vim \
              net-misc/curl www-servers/apache www-apache/mod_wsgi \
              www-apps/trac && \
    eselect news read --quiet && \
    rm -fr /usr/portage

RUN sed -i -e ' \
        /^APACHE2_OPTS/ { \
            s/-D INFO //; \
            s/-D STATUS //; \
            s/-D/-D APP_TRAC -D WSGI -D/ }' \
    /etc/conf.d/apache2
RUN sed -i -e '/LoadModule/ a WSGIDaemonProcess app01 processes=1 threads=10' /etc/apache2/modules.d/70_mod_wsgi.conf
RUN echo 'Include /etc/apache2/vhosts.d/trac.include' >> /etc/apache2/vhosts.d/default_vhost.include

RUN (echo; echo) | trac-admin /var/www/localhost/trac initenv
RUN trac-admin /var/www/localhost/trac permission add anonymous TRAC_ADMIN
RUN trac-admin /var/www/localhost/trac component remove component1 && \
    trac-admin /var/www/localhost/trac component remove component2 && \
    trac-admin /var/www/localhost/trac version remove 1.0 && \
    trac-admin /var/www/localhost/trac version remove 2.0 && \
    trac-admin /var/www/localhost/trac milestone remove milestone1 && \
    trac-admin /var/www/localhost/trac milestone remove milestone2 && \
    trac-admin /var/www/localhost/trac milestone remove milestone3 && \
    trac-admin /var/www/localhost/trac milestone remove milestone4
RUN mkdir /var/www/localhost/trac/{files,cgi-bin}
RUN chgrp -R apache /var/www/localhost/trac/{db,log,files,conf,plugins}
RUN chmod g+rwx /var/www/localhost/trac/{db,log,files,conf,plugins}
RUN chmod g+rw /var/www/localhost/trac/{db/trac.db,conf/trac.ini}

COPY trac.include /etc/apache2/vhosts.d/
COPY trac.wsgi /var/www/localhost/cgi-bin/
COPY run.sh /usr/local/sbin/
COPY Dockerfile /.Dockerfile
EXPOSE 80 443
VOLUME /usr/portage
VOLUME /usr/local/portage
VOLUME /var/tmp/portage
CMD /usr/local/sbin/run.sh<commit_msg>Building a Trac docker from gentoo-minimal<commit_after># Copyright (c) 2015, <NAME> <<EMAIL>>

FROM gentoo-minimal
MAINTAINER <NAME> <<EMAIL>>
LABEL description="Base system to run Trac in a Gentoo environment" \
      copyright="(c) 2015, <NAME> <<EMAIL>>" \
      license="MIT"

RUN sed -i -e 's/-\*//' /etc/portage/make.conf
RUN echo 'USE="$USE sqlite"' >> /etc/portage/make.conf
RUN sed -i -e '/USE_PYTHON/ s/3\.4/2.7 3.4/' \
           -e '/PYTHON_TARGETS/ s/python3_4/python2_7 python3_4/' /etc/portage/make.conf

# Install packages and immediately remove the portage tree to avoid increasing
# the image size too much. The user should mount a volume at this location
# instead to have the portage tree stored locally on the host OS.
RUN emerge-webrsync -q && \
    emerge -q www-servers/apache www-apache/mod_wsgi www-apps/trac && \
    eselect news read --quiet && \
    rm -fr /usr/portage

RUN sed -i -e ' \
        /^APACHE2_OPTS/ { \
            s/-D INFO //; \
            s/-D STATUS //; \
            s/-D/-D APP_TRAC -D WSGI -D/ }' \
    /etc/conf.d/apache2
RUN sed -i -e '/LoadModule/ a WSGIDaemonProcess app01 processes=1 threads=10' /etc/apache2/modules.d/70_mod_wsgi.conf
RUN echo 'Include /etc/apache2/vhosts.d/trac.include' >> /etc/apache2/vhosts.d/default_vhost.include

RUN (echo; echo) | trac-admin /var/www/localhost/trac initenv
RUN trac-admin /var/www/localhost/trac component remove component1 && \
    trac-admin /var/www/localhost/trac component remove component2 && \
    trac-admin /var/www/localhost/trac version remove 1.0 && \
    trac-admin /var/www/localhost/trac version remove 2.0 && \
    trac-admin /var/www/localhost/trac milestone remove milestone1 && \
    trac-admin /var/www/localhost/trac milestone remove milestone2 && \
    trac-admin /var/www/localhost/trac milestone remove milestone3 && \
    trac-admin /var/www/localhost/trac milestone remove milestone4
RUN trac-admin /var/www/localhost/trac permission add anonymous TRAC_ADMIN
RUN mkdir /var/www/localhost/trac/{files,cgi-bin}
RUN chgrp -R apache /var/www/localhost/trac/{db,log,files,conf,plugins}
RUN chmod g+rwx /var/www/localhost/trac/{db,log,files,conf,plugins}
RUN chmod g+rw /var/www/localhost/trac/{db/trac.db,conf/trac.ini}

COPY trac.include /etc/apache2/vhosts.d/
COPY trac.wsgi /var/www/localhost/cgi-bin/
COPY run.sh /usr/local/sbin/
COPY Dockerfile /.Dockerfile
EXPOSE 80 443
VOLUME /usr/portage
VOLUME /usr/local/portage
VOLUME /var/tmp/portage
VOLUME /var/www/localhost/trac/db
CMD /usr/local/sbin/run.sh
{'fraction_non_alphanumeric': 0.13506441223832527, 'fraction_numerical': 0.017713365539452495, 'mean_word_length': 3.072950819672131, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 37, 'xml': 0}, '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': '4276165', 'n_tokens_mistral': 1866, 'n_tokens_neox': 1753, 'n_words': 446}