Spaces:
Paused
Paused
| # Ubuntu base image ka use kar rahe hain | |
| FROM ubuntu:22.04 | |
| # Interactive prompts ko disable karne ke liye | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # System packages install karna (LXDE, XRDP, aur baaki zaroori tools) | |
| RUN apt-get update && apt-get install -y \ | |
| lxde \ | |
| xrdp \ | |
| xterm \ | |
| sudo \ | |
| curl \ | |
| wget \ | |
| git \ | |
| &> /dev/null && rm -rf /var/lib/apt/lists/* | |
| # Ek naya user create kar rahe hain kyunki Hugging Face root user allow nahi karta | |
| RUN useradd -m -s /bin/bash hfuser && \ | |
| echo "hfuser:password123" | chpasswd && \ | |
| adduser hfuser sudo | |
| # XRDP ko configure karna taaki wo root ke bina chal sake | |
| RUN sed -i 's/3389/7860/g' /etc/xrdp/xrdp.ini && \ | |
| sed -i 's/xrdp1/hfuser/g' /etc/xrdp/xrdp.ini && \ | |
| mkdir -p /var/run/xrdp /var/log/xrdp && \ | |
| chmod -R 777 /var/run/xrdp /var/log/xrdp /etc/xrdp | |
| # User switch karna | |
| USER hfuser | |
| WORKDIR /home/hfuser | |
| # Xsession setup karna desktop environment ke liye | |
| RUN echo "startlxde" > /home/hfuser/.xsession && \ | |
| chmod +x /home/hfuser/.xsession | |
| # Startup script ko copy aur configure karna | |
| COPY --chown=hfuser:hfuser start.sh /home/hfuser/start.sh | |
| RUN chmod +x /home/hfuser/start.sh | |
| # Hugging Face default port 7860 use karta hai | |
| EXPOSE 7860 | |
| # Container start hone par ye script chalegi | |
| CMD ["./start.sh"] | |