triflix commited on
Commit
dd2b3c4
·
verified ·
1 Parent(s): 7e8ce75

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # set working dir
4
+ WORKDIR /app
5
+
6
+ # install system deps (for uvicorn etc.)
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # copy project files
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ COPY . .
16
+
17
+ # expose port 7860
18
+ EXPOSE 7860
19
+
20
+ # create tmp dir (optional, container's /tmp will also work)
21
+ RUN mkdir -p /tmp/doto_tmp && chown 1000:1000 /tmp/doto_tmp || true
22
+
23
+ ENV TMP_DIR=/tmp
24
+
25
+ # run app
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]