| # Sử dụng Python 3.9 | |
| FROM python:3.9-slim | |
| # Thiết lập thư mục làm việc | |
| WORKDIR /app | |
| # Cài đặt Jupyter và các dependencies | |
| RUN pip install --no-cache-dir jupyter | |
| # Tạo thư mục /.local với quyền hạn đúng | |
| RUN mkdir -p /.local && chmod 777 /.local | |
| RUN mkdir -p /app && chmod 777 /app | |
| RUN mkdir -p /.cache && chmod 777 /.cache | |
| # Sao chép tệp requirements.txt vào thư mục làm việc | |
| COPY requirements.txt . | |
| # Cài đặt các dependencies từ requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Mở cổng 7860, nơi Jupyter sẽ chạy | |
| EXPOSE 7860 | |
| # Chạy lệnh để khởi động Jupyter Server với token cứng | |
| CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=7860", "--allow-root", "--NotebookApp.token='0429d4776d1540fcda06f9fe57bdc122c2cbd7ea4f78ea76'"] | |