| |
| FROM python:3.13 |
|
|
| |
| |
|
|
| |
| ENV CHROMADB_PATH=/data/chroma_db |
| ENV LOG_DIR=/data/logs |
| ENV DEBUG_DIR=/data/debug |
| ENV CACHE_DIR=/data/cache |
| ENV HF_HOME=/data/cache/huggingface |
| ENV DATA_DIR=/data |
|
|
| |
| RUN mkdir -p /data/chroma_db && \ |
| mkdir -p /data/logs && \ |
| mkdir -p /data/debug && \ |
| mkdir -p /data/cache/huggingface |
|
|
| |
| RUN useradd -m -u 1000 user |
|
|
| |
| RUN usermod -a -G staff user |
|
|
| |
| RUN chown -R root:staff /data && \ |
| chmod -R g+w /data |
|
|
| |
| USER user |
|
|
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
|
|
| |
| WORKDIR /code |
|
|
|
|
| |
| COPY ./requirements.txt /code/requirements.txt |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt |
|
|
| COPY . . |
|
|
| ARG HF_API_KEY |
| ENV HUGGINGFACE_HUB_TOKEN=$HF_API_KEY |
|
|
| RUN python -c "\ |
| from huggingface_hub import snapshot_download; \ |
| snapshot_download(repo_id='rressler/au_advisor_db', repo_type='model', local_dir='/data')" |
|
|
| RUN ls -lah /data/chroma_db && \ |
| find /data/chroma_db -type f -exec ls -lah {} \; && \ |
| echo "Total size of chroma_db directory:" && \ |
| du -sh /data/chroma_db |
|
|
| |
|
|
| |
| RUN mkdir -p /code/data && \ |
| ln -s /data/chroma_db /code/data/chroma_db && \ |
| ln -s /data/logs /code/data/logs && \ |
| ln -s /data/debug /code/data/debug |
| RUN ls -la /code/data && \ |
| readlink -f /code/data/chroma_db && \ |
| echo "Expected path: /data/chroma_db" && \ |
| find /code/data/chroma_db -type f | head -5 && \ |
| echo "------" && \ |
| find /data/chroma_db -type f | head -5 |
|
|
| RUN python -c "\ |
| import chromadb; \ |
| client = chromadb.PersistentClient(path='/code/data/chroma_db'); \ |
| collections = client.list_collections(); \ |
| print(f'β
Found collections: {[c.name for c in collections]}'); \ |
| col = client.get_or_create_collection('documents'); \ |
| docs = col.get(); \ |
| print(f'π Document count: {len(docs[\"ids\"])}'); \ |
| print(f'π Sample IDs: {docs[\"ids\"][:5]}') \ |
| " |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"] |