truglpk3 commited on
Commit
6701c72
·
1 Parent(s): 7633d9a

Fix dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -18
Dockerfile CHANGED
@@ -1,23 +1,13 @@
1
- FROM python:3.10-slim
2
 
3
- # Cài dependency hệ thống cho psycopg2
4
- RUN apt-get update && apt-get install -y \
5
- gcc \
6
- libpq-dev \
7
- && rm -rf /var/lib/apt/lists/*
8
-
9
- # Tắt cache HF
10
- ENV HF_HOME=/cache/huggingface
11
- RUN mkdir -p /cache/huggingface
12
 
13
  WORKDIR /app
14
 
15
- COPY requirements.txt .
16
-
17
- RUN pip install --no-cache-dir -r requirements.txt
18
-
19
- COPY . .
20
-
21
- EXPOSE 7860
22
 
23
- CMD ["uvicorn", "start:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM python:3.9
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
+ CMD ["uvicorn", "chatbot.main:app", "--host", "0.0.0.0", "--port", "7860"]