<commit_before>FROM python:alpine as production

# Configuration params
ARG INVENTREE_REPO="https://github.com/inventree/InvenTree.git"
ARG INVENTREE_VERSION="master"
ARG INVENTREE_HOME="/home/inventree"

ENV PYTHONUNBUFFERED 1

# InvenTree paths
ENV INVENTREE_SRC_DIR="$INVENTREE_HOME/src"
ENV INVENTREE_STATIC_ROOT="$INVENTREE_HOME/static"
ENV INVENTREE_MEDIA_ROOT="$INVENTREE_HOME/media"
ENV INVENTREE_LOG_DIR="$INVENTREE_HOME/log"
ENV INVENTREE_BACKUP_DIR="$INVENTREE_HOME/backup"
ENV INVENTREE_VENV="$INVENTREE_HOME/env"

RUN echo "Installing InvenTree '${INVENTREE_VERSION}' from ${INVENTREE_REPO}"

# Create user account
RUN addgroup -S inventreegroup && adduser -S inventree -G inventreegroup
WORKDIR /home/inventree

# Install git
RUN apk add --no-cache git

# Clone source code
RUN git clone --branch $INVENTREE_VERSION --depth 1 ${INVENTREE_REPO} ${INVENTREE_SRC_DIR}

# Install required system packages
RUN apk add --no-cache postgresql-contrib postgresql-dev libpq
RUN apk add --no-cache mariadb-connector-c mariadb-dev

# Install required PIP packages
RUN python -m venv $INVENTREE_VENV && pip install --upgrade pip setuptools wheel
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U invoke
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U psycopg2 mysqlclient pgcli mariadb

# Install InvenTree packages
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U -r $INVENTREE_SRC_DIR/requirements.txt

# Install supervisor
RUN apt add --no-cache supervisor

# Create required directories
RUN mkdir /home/inventree/media /home/inventree/static /home/inventree/log /home/inventree/backup

# Copy supervisor file
COPY deploy/inventree.conf /etc/supervisor/conf.d/inventree.conf

RUN sudo service supervisor start<commit_msg>gcc required<commit_after>FROM python:alpine as production

# Configuration params
ARG INVENTREE_REPO="https://github.com/inventree/InvenTree.git"
ARG INVENTREE_VERSION="master"
ARG INVENTREE_HOME="/home/inventree"

ENV PYTHONUNBUFFERED 1

# InvenTree paths
ENV INVENTREE_SRC_DIR="$INVENTREE_HOME/src"
ENV INVENTREE_STATIC_ROOT="$INVENTREE_HOME/static"
ENV INVENTREE_MEDIA_ROOT="$INVENTREE_HOME/media"
ENV INVENTREE_LOG_DIR="$INVENTREE_HOME/log"
ENV INVENTREE_BACKUP_DIR="$INVENTREE_HOME/backup"
ENV INVENTREE_VENV="$INVENTREE_HOME/env"

RUN echo "Installing InvenTree '${INVENTREE_VERSION}' from ${INVENTREE_REPO}"

# Create user account
RUN addgroup -S inventreegroup && adduser -S inventree -G inventreegroup
WORKDIR /home/inventree

# Install git
RUN apk add --no-cache git

# Clone source code
RUN git clone --branch $INVENTREE_VERSION --depth 1 ${INVENTREE_REPO} ${INVENTREE_SRC_DIR}

# Install required system packages
RUN apk add --no-cache gcc g++
RUN apk add --no-cache postgresql-contrib postgresql-dev libpq
RUN apk add --no-cache mariadb-connector-c mariadb-dev

# Install required PIP packages
RUN python -m venv $INVENTREE_VENV && pip install --upgrade pip setuptools wheel
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U invoke
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U psycopg2 mysqlclient pgcli mariadb

# Install InvenTree packages
RUN python -m venv $INVENTREE_VENV && pip install --no-cache-dir -U -r $INVENTREE_SRC_DIR/requirements.txt

# Install supervisor
RUN apt add --no-cache supervisor

# Create required directories
RUN mkdir /home/inventree/media /home/inventree/static /home/inventree/log /home/inventree/backup

# Copy supervisor file
COPY deploy/inventree.conf /etc/supervisor/conf.d/inventree.conf

RUN sudo service supervisor start
{'fraction_non_alphanumeric': 0.09321090706733445, 'fraction_numerical': 0.001669449081803005, 'mean_word_length': 5.340388007054674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2593553', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1211, 'n_words': 336}