SFM2001 commited on
Commit
89b9e00
·
1 Parent(s): 4f591e5

try to fix docker

Browse files
Files changed (2) hide show
  1. Dockerfile +8 -6
  2. requirements.txt +2 -1
Dockerfile CHANGED
@@ -1,12 +1,14 @@
1
  FROM python:3.12
2
 
3
- WORKDIR /app
 
 
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY . .
 
9
 
10
- EXPOSE 3478
11
 
12
- CMD ["python", "app.py"]
 
1
  FROM python:3.12
2
 
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
6
 
7
+ WORKDIR /app
 
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
+ COPY --chown=user . /app
13
 
14
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -9,4 +9,5 @@ optimum==1.26.1
9
  flask==3.1.1
10
  flask_login==0.6.3
11
  werkzeug==3.1.3
12
- flask_sqlalchemy==3.1.1
 
 
9
  flask==3.1.1
10
  flask_login==0.6.3
11
  werkzeug==3.1.3
12
+ flask_sqlalchemy==3.1.1
13
+ uvicorn