Spaces:
Paused
Paused
| # Use Python 3.9 as the base image | |
| FROM python:3.9 | |
| # Set environment variables | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install necessary packages | |
| RUN apt-get update && \ | |
| apt-get install -y \ | |
| curl \ | |
| sudo \ | |
| build-essential \ | |
| default-jdk \ | |
| default-jre \ | |
| g++ \ | |
| gcc \ | |
| libzbar0 \ | |
| fish \ | |
| ffmpeg \ | |
| nmap \ | |
| ca-certificates \ | |
| zsh \ | |
| curl | |
| # Install Node.js (LTS version) | |
| RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \ | |
| apt-get install -y nodejs | |
| # Install code-server | |
| RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.23.0-rc.2 | |
| # Install ollama | |
| RUN curl -fsSL https://ollama.com/install.sh | sh | |
| # Create a user to run code-server | |
| RUN useradd -m -s /bin/zsh coder && \ | |
| echo 'coder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
| # Create and set the working directory | |
| RUN mkdir -p /home/coder/genz/roop | |
| WORKDIR /home/coder/genz/roop | |
| # Clone the roop repository | |
| RUN git clone https://github.com/s0md3v/roop.git . | |
| # Change ownership and permissions of the roop directory and its contents | |
| RUN chown -R coder:coder /home/coder/genz/roop && \ | |
| chmod -R u+rwx /home/coder/genz/roop | |
| # Create code-server configuration directory | |
| RUN mkdir -p /home/coder/.local/share/code-server/User | |
| # Add settings.json to enable dark mode | |
| RUN echo '{ \ | |
| "workbench.colorTheme": "Default Dark Modern", \ | |
| "telemetry.enableTelemetry": true, \ | |
| "telemetry.enableCrashReporter": true \ | |
| }' > /home/coder/.local/share/code-server/User/settings.json | |
| # Change ownership of the configuration directory | |
| RUN chown -R coder:coder /home/coder/.local/share/code-server | |
| # Install Python extension for code-server | |
| RUN sudo -u coder code-server --install-extension ms-python.python | |
| # Expose the default code-server port | |
| EXPOSE 8080 | |
| # Switch to the coder user for running code-server | |
| USER coder | |
| WORKDIR /home/coder/genz | |
| # Start code-server with authentication | |
| CMD ["sh", "-c", "code-server --bind-addr 0.0.0.0:7860 --auth password"] | |
| # End of Dockerfile |