Sahil-nith commited on
Commit
6701e34
·
verified ·
1 Parent(s): 0127c21

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
5
+
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV PATH="/home/user/.local/bin:$PATH" \
9
+ HF_HOME=/home/user/.cache/huggingface
10
+ WORKDIR /home/user/app
11
+
12
+ COPY --chown=user requirements.txt .
13
+ RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ COPY --chown=user . .
17
+
18
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]