Spaces:
Paused
Paused
| FROM python:3.10 | |
| # ==== SYSTEM DEPS ==== | |
| RUN apt-get update && apt-get install -y wget gnupg unzip curl fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \ | |
| libatk1.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libnspr4 libnss3 libxcomposite1 libxdamage1 libxrandr2 \ | |
| libgbm1 libgtk-3-0 libxshmfence1 libxss1 lsb-release xdg-utils | |
| # ==== INSTALL CHROME ==== | |
| RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google.gpg && \ | |
| echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \ | |
| apt-get update && apt-get install -y google-chrome-stable | |
| # ==== INSTALL CHROMEDRIVER MATCHING V138 ==== | |
| RUN wget -q https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/138.0.7204.94/linux64/chromedriver-linux64.zip && \ | |
| unzip chromedriver-linux64.zip && \ | |
| mv chromedriver-linux64/chromedriver /usr/bin/chromedriver && \ | |
| chmod +x /usr/bin/chromedriver && \ | |
| rm -rf chromedriver-linux64* | |
| # Buat /tmp/.cache dan symlink / → /tmp | |
| RUN mkdir -p /tmp/.cache /tmp/.config && chmod -R 777 /tmp | |
| RUN ln -s /tmp/.cache /.cache || true | |
| # ==== INSTALL PYTHON DEPS ==== | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ==== APP ==== | |
| COPY ./app ./app | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |