hoangthiencm commited on
Commit
2df726f
·
verified ·
1 Parent(s): b1ca4dd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -1,9 +1,11 @@
1
- # Sử dụng Python 3.10
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
5
 
6
- # --- Cài đặt system dependencies (Cần cho Pandoc và xử lý ảnh) ---
 
 
 
7
  RUN apt-get update && \
8
  apt-get install -y \
9
  pandoc \
@@ -13,18 +15,18 @@ RUN apt-get update && \
13
  zlib1g-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Cập nhật pip
17
  RUN pip install --upgrade pip setuptools wheel
18
 
19
- # Copy requirements cài đặt thư viện
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy toàn bộ code vào
24
- COPY . .
25
 
26
- # Mở port 7860
27
  EXPOSE 7860
28
 
29
- # Lệnh chạy server (Quan trọng: chạy file server.py)
30
- CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
+ # --- Cài đặt system dependencies ---
6
+ # Pandoc: cần thiết cho pypandoc (Markdown -> Docx)
7
+ # Build tools: cần cho một số Python packages
8
+ # Image libraries: cần cho Pillow
9
  RUN apt-get update && \
10
  apt-get install -y \
11
  pandoc \
 
15
  zlib1g-dev \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Upgrade pip first
19
  RUN pip install --upgrade pip setuptools wheel
20
 
21
+ # Copy requirements and install Python dependencies
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # Copy application code
26
+ COPY app.py .
27
 
28
+ # Expose port
29
  EXPOSE 7860
30
 
31
+ # Run the application
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]