cryptobiosis commited on
Commit
59805d0
·
verified ·
1 Parent(s): 3f31c94

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.6
2
+ FROM python:3.11-slim
3
+
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ git \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH \
12
+ PYTHONDONTWRITEBYTECODE=1 \
13
+ PYTHONUNBUFFERED=1 \
14
+ HF_HOME=/home/user/.cache/huggingface
15
+
16
+ WORKDIR $HOME/app
17
+
18
+ COPY --chown=user:user requirements.txt .
19
+
20
+ RUN pip install --no-cache-dir --user --upgrade pip && \
21
+ pip install --no-cache-dir --user \
22
+ --extra-index-url https://download.pytorch.org/whl/cpu \
23
+ -r requirements.txt
24
+
25
+ COPY --chown=user:user app.py README.md ./
26
+
27
+ EXPOSE 7860
28
+
29
+ CMD ["python", "app.py"]