<commit_before>###
# Dockerfile for RAMADDA
###

FROM tomcat:jre8

ENV VERSION 2.1b

###
# Usual maintenance
###

RUN apt-get update

RUN apt-get -y install sudo

###
# Grab RAMADDA
###

RUN curl -SL \
  https://motherlode.ucar.edu/repository/entry/get/repository-${VERSION}.war?entryid=21405142-70bb-48f7-88c2-22a828955018 \
  -o webapps/repository.war

ENV DATA_DIR /data/repository

RUN mkdir -p $DATA_DIR

VOLUME $DATA_DIR

ENV JAVA_OPTS -d64 -Xmx4048m -Xms512m \
  -Dorg.apache.catalina.security.SecurityListener.UMASK=0007 -server \
  -Dramadda_home=$DATA_DIR -Dfile.encoding=utf-8

ENV CATALINA_OPTS -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

###
# Create tomcat user
###

RUN groupadd -r tomcat && \
	useradd -g tomcat -d ${CATALINA_HOME} -s /sbin/nologin  -c \
  "Tomcat user" tomcat && chown -R tomcat:tomcat ${CATALINA_HOME}

RUN echo "tomcat ALL=NOPASSWD: ALL" >> /etc/sudoers

WORKDIR $DATA_DIR

COPY startram.sh ${CATALINA_HOME}/bin/

RUN chown -R tomcat:tomcat /data/repository

USER tomcat

CMD ${CATALINA_HOME}/bin/startram.sh<commit_msg>cleaning up superfluous/default tomcat webapps<commit_after>###
# Dockerfile for RAMADDA
###

FROM tomcat:jre8

ENV VERSION 2.1b

###
# Usual maintenance
###

RUN apt-get update

RUN apt-get -y install sudo

###
# Grab RAMADDA
###

RUN curl -SL \
  https://motherlode.ucar.edu/repository/entry/get/repository-${VERSION}.war?entryid=21405142-70bb-48f7-88c2-22a828955018 \
  -o webapps/repository.war

ENV DATA_DIR /data/repository

RUN mkdir -p $DATA_DIR

VOLUME $DATA_DIR

ENV JAVA_OPTS -d64 -Xmx4048m -Xms512m \
  -Dorg.apache.catalina.security.SecurityListener.UMASK=0007 -server \
  -Dramadda_home=$DATA_DIR -Dfile.encoding=utf-8

ENV CATALINA_OPTS -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

###
# Create tomcat user
###

RUN groupadd -r tomcat && \
	useradd -g tomcat -d ${CATALINA_HOME} -s /sbin/nologin  -c \
  "Tomcat user" tomcat && chown -R tomcat:tomcat ${CATALINA_HOME}

RUN echo "tomcat ALL=NOPASSWD: ALL" >> /etc/sudoers

WORKDIR $DATA_DIR

COPY startram.sh ${CATALINA_HOME}/bin/

RUN chown -R tomcat:tomcat /data/repository

###
# server.xml with ports that will not conflict with TDS
###

COPY server.xml ${CATALINA_HOME}/conf/

###
# Clean up non-essential web apps
###

RUN rm -rf ${CATALINA_HOME}/webapps/ROOT \
           ${CATALINA_HOME}/webapps/docs \
           ${CATALINA_HOME}/webapps/examples \
           ${CATALINA_HOME}/webapps/host-manager \
           ${CATALINA_HOME}/webapps/manager

USER tomcat

CMD ${CATALINA_HOME}/bin/startram.sh
{'fraction_non_alphanumeric': 0.13203125, 'fraction_numerical': 0.034375, 'mean_word_length': 3.81390977443609, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4366403', 'n_tokens_mistral': 1092, 'n_tokens_neox': 998, 'n_words': 208}