Gor Solomon commited on
Commit
eca106d
·
1 Parent(s): 18c9d3d
Files changed (2) hide show
  1. Dockerfile +11 -19
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,24 +1,16 @@
1
- # Use a Conda base image
2
- FROM continuumio/miniconda3
3
 
4
- # Set environment variables
5
- ENV CONDA_ENV_NAME=myenv
6
- ENV PATH /opt/conda/envs/${CONDA_ENV_NAME}/bin:$PATH
7
 
8
- # Create Conda environment and install dependencies
9
- RUN conda create -n ${CONDA_ENV_NAME} python=3.12 \
10
- && conda install -n ${CONDA_ENV_NAME} -c conda-forge faiss-gpu numpy scipy \
11
- && conda clean --all --yes
12
 
13
- # Copy requirements file and install pip packages
14
- COPY requirements.txt /app/requirements.txt
15
- RUN /opt/conda/envs/${CONDA_ENV_NAME}/bin/pip install --no-cache-dir --upgrade -r /app/requirements.txt
16
-
17
- # Copy your application code
18
- COPY . /app
19
-
20
- # Set working directory
21
  WORKDIR /app
22
 
23
- # Command to run the application
24
- CMD ["python", "your_application.py"]
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
 
4
+ FROM python:3.12.4
 
 
5
 
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV PATH="/home/user/.local/bin:$PATH"
 
9
 
 
 
 
 
 
 
 
 
10
  WORKDIR /app
11
 
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ COPY --chown=user . /app
16
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ