| FROM python:3.11-slim | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV DEV_MODE=true | |
| ENV SSH_ENABLED=true | |
| ENV DISPLAY=:99 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| openssh-server \ | |
| sudo \ | |
| curl \ | |
| wget \ | |
| git \ | |
| vim \ | |
| xvfb \ | |
| x11vnc \ | |
| ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN mkdir /var/run/sshd \ | |
| && useradd -m -s /bin/bash devuser \ | |
| && echo "devuser:devpass" | chpasswd \ | |
| && echo "devuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/devuser \ | |
| && chmod 440 /etc/sudoers.d/devuser \ | |
| && echo "Port 22" >> /etc/ssh/sshd_config \ | |
| && echo "PermitRootLogin no" >> /etc/ssh/sshd_config \ | |
| && echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config | |
| WORKDIR /app | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r /app/requirements.txt \ | |
| && pip install --no-cache-dir jupyter jupyterlab ipython black flake8 pytest | |
| COPY . /app | |
| RUN mkdir -p /app/logs /app/temp /app/data /home/devuser/.ssh \ | |
| && chown -R devuser:devuser /home/devuser /app | |
| EXPOSE 22 7860 5900 8888 | |
| COPY dev-start.sh /dev-start.sh | |
| RUN chmod +x /dev-start.sh | |
| CMD ["/dev-start.sh"] | |