D
File size: 2,105 Bytes
0b789d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4dfe920
c5540a2
0b789d5
 
 
 
 
 
 
 
 
 
4dfe920
0b789d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5237871
 
 
0b789d5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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
RUN curl -fsSL https://bun.sh/install | bash
# 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

# End of Dockerfile