TG-99 commited on
Commit
16996b7
·
1 Parent(s): 2828875

BlackTape

Browse files
Files changed (4) hide show
  1. Dockerfile +50 -0
  2. docker-compose.yml +8 -0
  3. settings.json +6 -0
  4. startup.sh +2 -0
Dockerfile ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Ubuntu as base image
2
+ FROM rir18/mltb:latest
3
+
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ sudo \
10
+ nano \
11
+ && rm -rf /var/lib/apt/lists/*
12
+ # Install code-server
13
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
14
+ RUN curl https://cli-assets.heroku.com/install.sh | sh
15
+
16
+ # Create a non-root user
17
+ RUN useradd -m -s /bin/bash coder && \
18
+ echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
19
+
20
+ # Set working directory
21
+ WORKDIR /home/coder
22
+ # Create workspace directory
23
+ RUN mkdir -p /home/coder/workspace && \
24
+ chown -R coder:coder /home/coder
25
+
26
+ # Switch to root user to fix permissions for code-server
27
+ USER root
28
+ # Create config directory
29
+ RUN mkdir -p /home/coder/.config/code-server
30
+
31
+ # Install AI coding assistant extensions that support Gemini
32
+ #RUN code-server --install-extension Continue.continue || true
33
+ RUN code-server --install-extension donjayamanne.githistory
34
+
35
+ # Set up code-server config
36
+ RUN echo "bind-addr: 0.0.0.0:7860" > /home/coder/.config/code-server/config.yaml && \
37
+ echo "auth: password" >> /home/coder/.config/code-server/config.yaml && \
38
+ echo "password: ${PASSWORD}" >> /home/coder/.config/code-server/config.yaml && \
39
+ echo "cert: false" >> /home/coder/.config/code-server/config.yaml
40
+ # Set up code-server json
41
+ COPY ./settings.json /root/.local/share/code-server/User/settings.json
42
+
43
+ # Copy startup scripts
44
+ COPY --chown=coder:coder startup.sh /home/coder/startup.sh
45
+ RUN chmod +x /home/coder/startup.sh
46
+ # Expose port 7860 (Hugging Face Spaces default port)
47
+ EXPOSE 7860
48
+
49
+ # Start code-server with persistence
50
+ CMD ["/home/coder/startup.sh"]
docker-compose.yml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ mltb:
3
+ build: .
4
+ restart: on-failure
5
+ environment:
6
+ - PASSWORD=1234
7
+ ports:
8
+ - 7860:7860
settings.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "workbench.colorTheme": "Default Dark Modern",
3
+ "security.workspace.trust.enabled": false,
4
+ "editor.wordWrap": "on",
5
+ "files.autoSave": "afterDelay"
6
+ }
startup.sh ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ #!/bin/bash
2
+ exec code-server --bind-addr 0.0.0.0:7860 --auth password /home/coder/workspace