MajorTOM-Core-Viewer / Dockerfile
mikonvergence's picture
Update Dockerfile
6da8ebb verified
raw
history blame
1.46 kB
FROM continuumio/miniconda3
# 1. Set up user
RUN useradd -m -u 1000 user
# 2. Set Environment Variables
# LD_LIBRARY_PATH is crucial here. It helps Python find the MKL libraries we are about to install.
ENV HOME=/home/user \
PATH=/opt/conda/envs/app_env/bin:$PATH \
LD_LIBRARY_PATH=/opt/conda/envs/app_env/lib:$LD_LIBRARY_PATH
# 3. Working Directory
WORKDIR /home/user/app
# 4. Create Conda Env
RUN conda create -n app_env python=3.9 wget -y
# 5. Install Conda Packages (FIXED)
# We explicitly install 'mkl' to satisfy the missing shared object error.
RUN conda install -n app_env -c pytorch -c nvidia -c conda-forge faiss-gpu=1.7.4 mkl -y && \
conda clean -ya
# 6. Install Pip Requirements
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 7. Fix Permissions
RUN chown -R user:user /home/user/app
# 8. Switch to User
USER user
# 9. Download Files
RUN wget https://huggingface.co/datasets/mikonvergence/MajorTOM-SigLIP-Index-Viewer-App/resolve/main/siglip_ivfpq.index -O siglip_ivfpq.index && \
wget https://huggingface.co/datasets/mikonvergence/MajorTOM-SigLIP-Index-Viewer-App/resolve/main/siglip_ivfpq_metadata.parquet -O siglip_ivfpq_metadata.parquet
# 10. Copy App Code
COPY --chown=user *.py *.css ./
COPY --chown=user helpers/* ./helpers/
# 11. Entrypoint
ENTRYPOINT ["solara", "run", "app.py", "--host=0.0.0.0", "--port", "7860", "--production"]