|
FROM python:3.11.5-bookworm |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libhdf5-serial-dev \ |
|
libsndfile1 \ |
|
curl \ |
|
git \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN useradd -m -u 1000 user && chown -R user:user /home/user && chmod -R 777 /home/user |
|
|
|
|
|
USER user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
WORKDIR $HOME |
|
|
|
|
|
RUN mkdir -p $HOME/app $HOME/config $HOME/db $HOME/src && \ |
|
chmod 777 $HOME/app $HOME/config $HOME/db $HOME/src |
|
|
|
|
|
ENV PATH="$HOME/.venv/bin:$PATH" |
|
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | python3 - \ |
|
&& poetry config virtualenvs.create true \ |
|
&& poetry config cache-dir /home/user/.cache/poetry \ |
|
&& poetry config virtualenvs.path /home/user/.local/share/virtualenvs |
|
|
|
|
|
RUN git clone https://github.com/dan-s-mueller/aerospace_chatbot.git /tmp/aerospace_chatbot && \ |
|
cp /tmp/aerospace_chatbot/pyproject.toml /tmp/aerospace_chatbot/poetry.lock ./ && \ |
|
cp -r /tmp/aerospace_chatbot/app/* $HOME/app/ && \ |
|
cp -r /tmp/aerospace_chatbot/config/* $HOME/config/ && \ |
|
cp -r /tmp/aerospace_chatbot/src/* $HOME/src/ && \ |
|
python3 -m pip install --user --no-warn-script-location poetry && \ |
|
poetry config virtualenvs.in-project true && \ |
|
poetry install --no-interaction --no-ansi && \ |
|
rm -rf /tmp/aerospace_chatbot |
|
|
|
|
|
ENV LOCAL_DB_PATH=$HOME/db |
|
ENV PYTHONPATH=$HOME/src:$PYTHONPATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
CMD streamlit run app.py \ |
|
--server.headless true \ |
|
--server.enableCORS false \ |
|
--server.enableXsrfProtection false \ |
|
--server.fileWatcherType none |