Download Dockerfile from MB-IDK/MSReward: direct link, hf CLI and curl.
- Browser
- Download file 3.24 kB
-
https://huggingface.co/spaces/MB-IDK/MSReward/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/MB-IDK/MSReward/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/MB-IDK/MSReward/resolve/main/Dockerfile
3.24 kB
| ############################################################################### | |
| # Dockerfile pour Hugging Face Spaces - Microsoft Rewards Script | |
| # | |
| # Ce Dockerfile : | |
| # 1. Clone le repo GitHub et compile le projet TypeScript | |
| # 2. Installe Python + Gradio pour l'interface web (port 7860) | |
| # 3. Lance app.py qui gère les credentials via les HF Secrets | |
| # | |
| # Secrets a configurer dans HF Spaces : | |
| # - MS_ACCOUNTS : JSON array, ex: [{"email":"ton@mail.com","password":"tonmdp"}] | |
| # ou bien separement : | |
| # - MS_EMAIL : ton email Microsoft | |
| # - MS_PASSWORD : ton mot de passe Microsoft | |
| ############################################################################### | |
| FROM node:22-slim | |
| # Meta pour Hugging Face Spaces | |
| LABEL maintainer="user" | |
| LABEL description="Microsoft Rewards Script - Hugging Face Space" | |
| # Variables d'environnement | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PLAYWRIGHT_BROWSERS_PATH=0 \ | |
| NODE_ENV=production \ | |
| TZ=Europe/Paris \ | |
| FORCE_HEADLESS=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Installer les dependances systeme : Python3, pip, cron, Chromium deps, git | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| git \ | |
| cron \ | |
| gettext-base \ | |
| tzdata \ | |
| ca-certificates \ | |
| curl \ | |
| libglib2.0-0 \ | |
| libdbus-1-3 \ | |
| libexpat1 \ | |
| libfontconfig1 \ | |
| libgtk-3-0 \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libasound2 \ | |
| libflac12 \ | |
| libatk1.0-0 \ | |
| libatspi2.0-0 \ | |
| libdrm2 \ | |
| libgbm1 \ | |
| libdav1d6 \ | |
| libx11-6 \ | |
| libx11-xcb1 \ | |
| libxcomposite1 \ | |
| libxcursor1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxi6 \ | |
| libxrandr2 \ | |
| libxrender1 \ | |
| libxss1 \ | |
| libxtst6 \ | |
| libdouble-conversion3 \ | |
| && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | |
| # Repertoire de travail pour le script Microsoft Rewards | |
| WORKDIR /usr/src/microsoft-rewards-script | |
| # Cloner le repo | |
| RUN git clone https://github.com/TheNetsky/Microsoft-Rewards-Script.git /usr/src/microsoft-rewards-script | |
| # Installer les dependances Node.js et compiler | |
| RUN npm ci --ignore-scripts \ | |
| && npm run build \ | |
| && rm -rf node_modules \ | |
| && npm ci --omit=dev --ignore-scripts \ | |
| && npm cache clean --force | |
| # Installer le navigateur Chromium pour Playwright | |
| RUN npx playwright install --with-deps --only-shell chromium \ | |
| && rm -rf /root/.cache /tmp/* /var/tmp/* | |
| # Config par defaut : headless = true pour Docker | |
| RUN sed -i 's/"headless": false/"headless": true/' /usr/src/microsoft-rewards-script/src/config.json || true | |
| # Repertoire pour les sessions persistantes | |
| RUN mkdir -p /usr/src/microsoft-rewards-script/dist/sessions | |
| # Repertoire de travail pour l'app Python | |
| WORKDIR /app | |
| # Installer les dependances Python (Gradio + APScheduler) | |
| RUN pip3 install --no-cache-dir --break-system-packages \ | |
| gradio \ | |
| apscheduler | |
| # Copier l'application Python | |
| COPY app.py /app/app.py | |
| # Exposer le port 7860 (requis par Hugging Face Spaces) | |
| EXPOSE 7860 | |
| # Utilisateur non-root pour HF Spaces | |
| RUN useradd -m -u 1000 appuser \ | |
| && chown -R appuser:appuser /app \ | |
| && chown -R appuser:appuser /usr/src/microsoft-rewards-script | |
| USER appuser | |
| # Lancer l'app Gradio | |
| CMD ["python3", "/app/app.py"] | |