<commit_before>FROM ubuntu:14.04
ENV PYTHONUNBUFFERED 1
EXPOSE 8000

# Install basics
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y build-essential postgresql
RUN apt-get install -y python-virtualenv python3-pip # to make builds faster

# Create database
RUN service postgresql start && \
    su -c "createuser asylum" postgres && \
    su -c "createdb -E utf-8 -T template0 -O asylum asylum" postgres && \
    su -c "psql -U postgres -d postgres -c \"alter user asylum with password '<PASSWORD>';\"" postgres

# Install system packages
COPY project/requirements.apt /opt/asylum/
WORKDIR /opt/asylum
RUN awk '/^\s*[^#]/' requirements.apt | xargs -r -- sudo apt-get install --no-install-recommends -y
RUN virtualenv -p `which python3.4` venv

# Install python requirements
COPY project /opt/asylum/
WORKDIR /opt/asylum
RUN . venv/bin/activate && pip install -r requirements/local.txt

# Configure application
RUN echo "DATABASE_URL=postgres://asylum:asylum@localhost/asylum" > .env

# Create
RUN service postgresql start; \
    . venv/bin/activate && \
    ./manage.py migrate && \
    echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '<EMAIL>', 'admin')" | ./manage.py shell

ENTRYPOINT ["/opt/asylum/docker-entrypoint.sh"]<commit_msg>Optimise build speed when changing project files and not requirements (10s of seconds to less than 10)<commit_after>FROM ubuntu:14.04
ENV PYTHONUNBUFFERED 1
EXPOSE 8000

# Install basics
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y build-essential postgresql
RUN apt-get install -y python-virtualenv python3-pip # to make builds faster

# Create database
RUN service postgresql start && \
    su -c "createuser asylum" postgres && \
    su -c "createdb -E utf-8 -T template0 -O asylum asylum" postgres && \
    su -c "psql -U postgres -d postgres -c \"alter user asylum with password '<PASSWORD>';\"" postgres

# Install system packages
COPY project/requirements.apt /opt/asylum/
WORKDIR /opt/asylum
RUN awk '/^\s*[^#]/' requirements.apt | xargs -r -- sudo apt-get install --no-install-recommends -y
RUN virtualenv -p `which python3.4` venv

# Install python requirements
COPY project/requirements /opt/asylum/requirements/
WORKDIR /opt/asylum
RUN . venv/bin/activate && pip install -r requirements/local.txt

# Configure application
COPY project /opt/asylum/
RUN echo "DATABASE_URL=postgres://asylum:asylum@localhost/asylum" > .env

# Create
RUN service postgresql start; \
    . venv/bin/activate && \
    ./manage.py migrate && \
    echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '<EMAIL>', 'admin')" | ./manage.py shell

ENTRYPOINT ["/opt/asylum/docker-entrypoint.sh"]
{'fraction_non_alphanumeric': 0.12128984976181752, 'fraction_numerical': 0.011725906925613778, 'mean_word_length': 3.764397905759162, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5639975', 'n_tokens_mistral': 936, 'n_tokens_neox': 859, 'n_words': 284}