Seyomi commited on
Commit
e1563e4
·
verified ·
1 Parent(s): 1537e80

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV SYNTHGUARD_MODEL_DIR=/app/models/synthguard_kmer
6
+
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
+
11
+ WORKDIR /app
12
+
13
+ COPY --chown=user requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ COPY --chown=user . /app
17
+
18
+ # Download k-mer models from HF Hub at build time
19
+ RUN python -c "from huggingface_hub import snapshot_download; snapshot_download('Seyomi/synthguard-kmer', repo_type='model', local_dir='models/synthguard_kmer')"
20
+
21
+ EXPOSE 7860
22
+
23
+ CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]