Hana Celeste commited on
Commit
9b88d48
·
verified ·
1 Parent(s): 3a3135c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -2,6 +2,7 @@ FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  fonts-liberation \
7
  libgbm-dev \
@@ -10,12 +11,18 @@ RUN apt-get update && apt-get install -y \
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- RUN chmod -R +x /usr/local/lib/python3.10/dist-packages/undetected_playwright/driver/
 
14
 
 
15
  RUN playwright install chromium
16
 
 
 
 
17
  COPY . .
18
 
 
19
  RUN chmod -R 777 /app
20
 
21
  ENV PYTHONUNBUFFERED=1
 
2
 
3
  WORKDIR /app
4
 
5
+ # Cài đặt các gói hệ thống cần thiết
6
  RUN apt-get update && apt-get install -y \
7
  fonts-liberation \
8
  libgbm-dev \
 
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # THIẾT LẬP BIẾN MÔI TRƯỜNG ĐƯỜNG DẪN TRÌNH DUYỆT CỐ ĐỊNH
15
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
16
 
17
+ # Cài đặt browser vào đúng thư mục đã định danh
18
  RUN playwright install chromium
19
 
20
+ # Cấp quyền thực thi toàn bộ thư mục driver (Sửa lỗi Permission cũ)
21
+ RUN chmod -R +x /usr/local/lib/python3.10/dist-packages/undetected_playwright/driver/ || true
22
+
23
  COPY . .
24
 
25
+ # Đảm bảo quyền chạy cho app
26
  RUN chmod -R 777 /app
27
 
28
  ENV PYTHONUNBUFFERED=1