<commit_before>FROM cantara/zulu
MAINTAINER <NAME> <<EMAIL>>

ENV USER=configservice
ENV HOME=/home/$USER
RUN useradd -d "$HOME" -u 500 -m -s /bin/bash $USER

RUN apt-get update && apt-get install -y --no-install-recommends \
		supervisor cron logrotate \
	&& rm -rf /var/lib/apt/lists/*

## Set up start of services
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

## Configure application
COPY application_scripts/* $HOME/
COPY CRON $HOME/
RUN chmod 755 $HOME/*.sh

##Directories to persist for data volumes
RUN mkdir $HOME/logs
RUN mkdir $HOME/db
COPY config_override_templates/* $HOME/config_override/

##Configure crontab
ADD crontab /etc/cron.d/configservice
RUN chmod 0644 /etc/cron.d/configservice
RUN touch /var/log/cron.log
RUN chown $USER /var/log/cron.log
RUN crontab -u $USER /etc/cron.d/configservice

##Configure logrotate
COPY logrotate_config/logrotate.conf /etc/logrotate.conf
COPY logrotate_config/logrotate.d/* /etc/logrotate.d/

#Permissions
RUN chown -R $USER:$USER $HOME

##Download application
RUN su - $USER -c "$HOME/update-service.sh"

VOLUME ["$HOME/config_override", "$HOME/db", "$HOME/logs"]

EXPOSE 8086
CMD /usr/bin/supervisord
<commit_msg>Fix bug introduced when parent Docker image was updated<commit_after>FROM cantara/zulu
MAINTAINER <NAME> <<EMAIL>>

ENV USER=configservice
ENV HOME=/home/$USER
RUN useradd -d "$HOME" -u 500 -m -s /bin/bash $USER

RUN apt-get update && apt-get install -y --no-install-recommends \
		supervisor cron logrotate \
	&& rm -rf /var/lib/apt/lists/*

## Fix for python/supervisor error "ImportError: No module named pkg_resources"
RUN wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

## Set up start of services
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

## Download scripts
RUN wget https://raw.githubusercontent.com/Cantara/devops/master/pull_deploy/linux/build/Docker/application_scripts/start-service.sh \
    -P $HOME && \
    wget https://raw.githubusercontent.com/Cantara/devops/master/pull_deploy/linux/build/Docker/application_scripts/stop-service.sh \
    -P $HOME && \
    wget https://raw.githubusercontent.com/Cantara/devops/master/pull_deploy/linux/build/Docker/application_scripts/update-service.sh \
    -P $HOME

## Configure application
#COPY application_scripts/* $HOME/
COPY CRON $HOME/
RUN chmod 755 $HOME/*.sh

##Directories to persist for data volumes
RUN mkdir $HOME/logs
RUN mkdir $HOME/db
COPY config_override_templates/* $HOME/config_override/

##Configure crontab
ADD crontab /etc/cron.d/configservice
RUN chmod 0644 /etc/cron.d/configservice
RUN touch /var/log/cron.log
RUN chown $USER /var/log/cron.log
RUN crontab -u $USER /etc/cron.d/configservice

##Configure logrotate
COPY logrotate_config/logrotate.conf /etc/logrotate.conf
COPY logrotate_config/logrotate.d/* /etc/logrotate.d/

#Permissions
RUN chown -R $USER:$USER $HOME

##Download application
RUN su - $USER -c "$HOME/update-service.sh"

VOLUME ["$HOME/config_override", "$HOME/db", "$HOME/logs"]

EXPOSE 8086
CMD /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

{'fraction_non_alphanumeric': 0.12784810126582277, 'fraction_numerical': 0.008860759493670886, 'mean_word_length': 4.207578253706754, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3670113', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1103, 'n_words': 281}