kltn20133118 commited on
Commit
413061c
·
verified ·
1 Parent(s): 5a5a6a4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,30 +1,31 @@
1
  FROM python:3.11
2
 
 
3
  WORKDIR /code
4
- WORKDIR /code/temp
5
- WORKDIR /nltk_data
6
 
7
- WORKDIR /code
8
- WORKDIR /code/temp
9
- WORKDIR /nltk_data
10
-
11
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
12
- RUN apt-get update && apt-get install -y poppler-utils
13
 
14
- RUN mkdir -p /code
15
  RUN mkdir -p /code/temp
16
  RUN mkdir -p /nltk_data
 
 
17
 
18
- USER root
19
-
20
  RUN chmod -R 777 /nltk_data
21
  RUN chmod -R 777 /code
22
  RUN chmod -R 777 /code/temp
 
 
23
 
 
24
  COPY ./requirements.txt /code/requirements.txt
25
  COPY ./firebase_certificate.json /code/firebase_certificate.json
26
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
27
 
 
28
  COPY . .
29
 
 
30
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
1
  FROM python:3.11
2
 
3
+ # Thiết lập thư mục làm việc
4
  WORKDIR /code
 
 
5
 
6
+ # Cài đặt các gói cần thiết
7
+ RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 poppler-utils
 
 
 
 
8
 
9
+ # Tạo các thư mục cần thiết
10
  RUN mkdir -p /code/temp
11
  RUN mkdir -p /nltk_data
12
+ RUN mkdir -p /code/user_file
13
+ RUN mkdir -p /code/vector_database
14
 
15
+ # Thiết lập quyền truy cập
 
16
  RUN chmod -R 777 /nltk_data
17
  RUN chmod -R 777 /code
18
  RUN chmod -R 777 /code/temp
19
+ RUN chmod -R 777 /code/user_file
20
+ RUN chmod -R 777 /code/vector_database
21
 
22
+ # Sao chép tệp yêu cầu và cài đặt các gói Python
23
  COPY ./requirements.txt /code/requirements.txt
24
  COPY ./firebase_certificate.json /code/firebase_certificate.json
25
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
26
 
27
+ # Sao chép toàn bộ mã nguồn vào thư mục làm việc
28
  COPY . .
29
 
30
+ # Thiết lập lệnh khởi động
31
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]