ar08 commited on
Commit
c2c23cd
·
verified ·
1 Parent(s): 4d4514f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -80
Dockerfile CHANGED
@@ -1,88 +1,31 @@
1
- # Use Python 3.9 as the base image
2
- FROM python:3.9
3
 
4
- # Set environment variables
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Install necessary packages
8
- RUN apt-get update && \
9
- apt-get install -y \
10
- curl \
11
- sudo \
12
  build-essential \
13
- default-jdk \
14
- default-jre \
15
- g++ \
16
- gcc \
17
- libzbar0 \
18
- fish \
19
- ffmpeg \
20
- nmap \
21
- ca-certificates \
22
- debootstrap \
23
  curl
24
 
25
- # Install Node.js (LTS version)
26
- RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \
27
- apt-get install -y nodejs
28
-
29
- # Install code-server
30
- RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.23.0-rc.2
31
-
32
- # Install ollama
33
- RUN curl -fsSL https://ollama.com/install.sh | sh
34
-
35
- # Create a user to run code-server
36
- RUN useradd -m -s /bin/bash coder && \
37
- echo 'coder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
38
-
39
- # Create and set the working directory
40
- RUN mkdir -p /home/coder/genz/roop
41
- WORKDIR /home/coder/genz/roop
42
-
43
- # Clone the roop repository
44
- RUN git clone https://github.com/s0md3v/roop.git .
45
-
46
- # Change ownership and permissions of the roop directory and its contents
47
- RUN chown -R coder:coder /home/coder/genz/roop && \
48
- chmod -R u+rwx /home/coder/genz/roop
49
-
50
- # Create code-server configuration directory
51
- RUN mkdir -p /home/coder/.local/share/code-server/User
52
-
53
- # Add settings.json to enable dark mode
54
- RUN echo '{ \
55
- "workbench.colorTheme": "Default Dark Modern", \
56
- "telemetry.enableTelemetry": true, \
57
- "telemetry.enableCrashReporter": true \
58
- }' > /home/coder/.local/share/code-server/User/settings.json
59
-
60
- # Change ownership of the configuration directory
61
- RUN chown -R coder:coder /home/coder/.local/share/code-server
62
-
63
- # Install Python extension for code-server
64
- RUN sudo -u coder code-server --install-extension ms-python.python
65
-
66
- # Expose the default code-server port
67
- EXPOSE 8080
68
-
69
- # Create a minimal Debian system using debootstrap
70
- RUN mkdir /chroot && \
71
- debootstrap --variant=minbase buster /chroot http://deb.debian.org/debian/
72
 
73
- # Set up necessary mounts and devices for chroot
74
- RUN mount --bind /proc /chroot/proc && \
75
- mount --bind /sys /chroot/sys && \
76
- mount --bind /dev /chroot/dev
 
 
77
 
78
- # Create a startup script to initialize chroot and start code-server
79
- RUN echo '#!/bin/bash\n\
80
- chroot /chroot /bin/bash -c "cd /home/coder/genz && code-server --bind-addr 0.0.0.0:8080 --auth none"' > /home/coder/start.sh && \
81
- chmod +x /home/coder/start.sh
82
 
83
- # Switch to the coder user for running code-server
84
- USER coder
85
- WORKDIR /home/coder/genz
86
 
87
- # Start code-server with authentication
88
- CMD ["/home/coder/start.sh"]
 
1
+ # Use the latest official Ubuntu as a parent image
2
+ FROM ubuntu:latest
3
 
4
+ # Install dependencies
5
+ RUN apt-get update && apt-get install -y \
 
 
 
 
 
 
6
  build-essential \
7
+ cmake \
8
+ git \
9
+ libwebsockets-dev \
10
+ libjson-c-dev \
11
+ libssl-dev \
 
 
 
 
 
12
  curl
13
 
14
+ # Clone the ttyd repository
15
+ RUN git clone https://github.com/tsl0922/ttyd.git
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ # Build ttyd
18
+ WORKDIR ttyd
19
+ RUN mkdir build
20
+ WORKDIR build
21
+ RUN cmake ..
22
+ RUN make && make install
23
 
24
+ # Set the command to run ttyd
25
+ ENTRYPOINT ["ttyd"]
 
 
26
 
27
+ # Set the default arguments for ttyd
28
+ CMD ["-p", "7860", "--address", "0.0.0.0", "bash"]
 
29
 
30
+ # Expose the port ttyd will run on
31
+ EXPOSE 7860