Sahinal4698 commited on
Commit
be2b277
·
verified ·
1 Parent(s): 8e27dbd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -40
Dockerfile CHANGED
@@ -1,50 +1,55 @@
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"]
 
1
+ FROM ubuntu:22.04
2
+
3
+ # রুট ইউজার হিসেবে প্যাকেজ ইন্সটল করা
4
+ USER root
5
 
 
6
  ENV DEBIAN_FRONTEND=noninteractive
7
 
8
+ # ১. প্রয়োজনীয় বেসিক টুলস এবং কম্পাইলার (build-essential) ইনস্টল
9
  RUN apt-get update && apt-get install -y \
10
+ curl \
11
+ git \
12
  sudo \
13
+ wget \
14
+ gnupg \
15
+ build-essential \
16
+ bash-completion \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # ২. Python, PIP এবং Full Python Dev Packages ইনস্টল করা
20
+ RUN apt-get update && apt-get install -y \
21
+ python3 \
22
+ python3-pip \
23
+ python3-venv \
24
+ python3-dev \
25
+ && rm -rf /var/lib/apt/lists/*
26
+
27
+ # ৩. Node.js (JavaScript Runtime) এবং NPM ইনস্টল করা
28
+ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
29
+ && apt-get install -y nodejs \
30
  && rm -rf /var/lib/apt/lists/*
31
+
32
+ # ৪. code-server (VS Code) অফিশিয়াল স্ক্রিপ্ট দিয়ে ইনস্টল
33
  RUN curl -fsSL https://code-server.dev/install.sh | sh
 
34
 
35
+ # ৫. Hugging Face-এর জন্য ইউজার এনভায়রনমেন্ট সেটআপ
36
+ RUN useradd -m -u 1000 user && echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
 
37
 
38
+ # ডিফল্ট শেল হিসেবে BASH সেট করা (যাতে Up-Arrow এবং Tab কাজ করে)
39
+ ENV SHELL=/bin/bash
 
 
 
40
 
41
+ USER user
42
+ ENV HOME=/home/user \
43
+ PATH=/home/user/.local/bin:$PATH
44
+
45
+ WORKDIR $HOME
46
+
47
+ # ৬. টার্মিনালে কালারফুল Bash, অটো-কমপ্লিশন এবং Python/PIP-এর শর্টকাট (Alias) সেট করা
48
+ RUN echo "source /etc/profile.sh" >> ~/.bashrc && \
49
+ echo "source /usr/share/bash-completion/bash_completion" >> ~/.bashrc && \
50
+ echo "alias python='python3'" >> ~/.bashrc && \
51
+ echo "alias pip='pip3'" >> ~/.bashrc && \
52
+ echo "alias py='python3'" >> ~/.bashrc
53
+
54
+ # ৭. VS Code রান করার ফাইনাল কমান্ড
55
+ CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."]