kimhyunwoo commited on
Commit
482bf32
·
verified ·
1 Parent(s): 01f8624

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ FROM python:3.11-slim
3
+
4
+
5
+ ENV PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1 \
7
+ PIP_NO_CACHE_DIR=1 \
8
+ PATH="/home/user/.local/bin:$PATH"
9
+
10
+
11
+ RUN useradd -m -u 1000 user && \
12
+ apt-get update && apt-get install -y --no-install-recommends \
13
+ ca-certificates curl && \
14
+ rm -rf /var/lib/apt/lists/*
15
+
16
+
17
+ WORKDIR /app
18
+ COPY --chown=user requirements.txt /app/requirements.txt
19
+ RUN pip install --upgrade -r requirements.txt
20
+
21
+
22
+ COPY --chown=user . /app
23
+ USER user
24
+
25
+
26
+ # HF Docker Space must listen on 7860
27
+ EXPOSE 7860
28
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]