File size: 2,028 Bytes
70cf9fa
 
b7b6a5d
70cf9fa
 
b7b6a5d
70cf9fa
 
 
67da0ba
 
70cf9fa
 
 
 
95c4849
 
4e6a9b5
982187a
13f95cc
 
3a29ab2
13f95cc
70cf9fa
cadd21c
 
 
 
70cf9fa
958f672
70cf9fa
2d4d4c5
3fd6ef0
 
70cf9fa
3a29ab2
70cf9fa
 
 
f711b70
 
70cf9fa
2d4d4c5
f711b70
 
 
 
 
2d4d4c5
70cf9fa
460a371
70cf9fa
e9883a2
2b00342
705e3f4
 
 
 
f1a3800
e9883a2
460a371
70cf9fa
cadd21c
 
 
70cf9fa
a112181
70cf9fa
 
2139c7e
2d4d4c5
84da246
388b946
cadd21c
e9883a2
cadd21c
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
# 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 root
WORKDIR /home/coder/genz

# Start code-server with authentication
CMD ["sh", "-c", "code-server --bind-addr 0.0.0.0:7860 --auth none"]

# End of Dockerfile