shashwatIDR commited on
Commit
1a080a1
·
verified ·
1 Parent(s): 9dafad4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +101 -11
Dockerfile CHANGED
@@ -3,7 +3,7 @@ FROM codercom/code-server:latest
3
  # Switch to root user for setup
4
  USER root
5
 
6
- # Install Python, Node.js, and other development tools
7
  RUN apt-get update && \
8
  apt-get install -y \
9
  python3 \
@@ -14,18 +14,104 @@ RUN apt-get update && \
14
  curl \
15
  git \
16
  build-essential \
17
- sudo && \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
19
  apt-get install -y nodejs && \
20
  apt-get clean && \
21
  rm -rf /var/lib/apt/lists/*
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  # Remove the externally-managed-environment file to allow pip installs
24
  RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED
25
 
26
- # Give coder user sudo privileges without password for package management
27
- RUN echo "coder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
28
-
29
  # Create the working directory and set proper ownership
30
  RUN mkdir -p /animesh && \
31
  chown -R coder:coder /animesh
@@ -50,15 +136,19 @@ ENV PATH="/home/coder/.venv/bin:/home/coder/.npm-global/bin:/home/coder/.local/b
50
  # Upgrade pip in the virtual environment
51
  RUN /home/coder/.venv/bin/pip install --upgrade pip
52
 
 
 
 
 
 
 
 
 
53
  # Set the working directory
54
  WORKDIR /animesh
55
 
56
  # Expose port for Hugging Face Spaces
57
  EXPOSE 7860
58
 
59
- # Create a startup script that ensures virtual environment is activated
60
- RUN echo '#!/bin/bash\nsource /home/coder/.venv/bin/activate\nexec "$@"' > /home/coder/entrypoint.sh && \
61
- chmod +x /home/coder/entrypoint.sh
62
-
63
- # Run code-server with proper configuration
64
- CMD ["code-server", "--auth=none", "--bind-addr", "0.0.0.0:7860", "/animesh"]
 
3
  # Switch to root user for setup
4
  USER root
5
 
6
+ # Install Python, Node.js, and comprehensive development tools
7
  RUN apt-get update && \
8
  apt-get install -y \
9
  python3 \
 
14
  curl \
15
  git \
16
  build-essential \
17
+ wget \
18
+ unzip \
19
+ vim \
20
+ nano \
21
+ htop \
22
+ tree \
23
+ jq \
24
+ sqlite3 \
25
+ postgresql-client \
26
+ mysql-client \
27
+ redis-tools \
28
+ chromium-browser \
29
+ xvfb \
30
+ fonts-liberation \
31
+ libasound2 \
32
+ libatk-bridge2.0-0 \
33
+ libdrm2 \
34
+ libxkbcommon0 \
35
+ libxss1 \
36
+ libgconf-2-4 \
37
+ libxrandr2 \
38
+ libasound2 \
39
+ libpangocairo-1.0-0 \
40
+ libatk1.0-0 \
41
+ libcairo-gobject2 \
42
+ libgtk-3-0 \
43
+ libgdk-pixbuf2.0-0 \
44
+ ffmpeg \
45
+ imagemagick \
46
+ pandoc \
47
+ texlive-xetex \
48
+ texlive-fonts-recommended \
49
+ texlive-plain-generic && \
50
  curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
51
  apt-get install -y nodejs && \
52
  apt-get clean && \
53
  rm -rf /var/lib/apt/lists/*
54
 
55
+ # Install common Python packages globally to avoid runtime issues
56
+ RUN pip3 install --break-system-packages \
57
+ flask \
58
+ fastapi \
59
+ uvicorn \
60
+ requests \
61
+ beautifulsoup4 \
62
+ selenium \
63
+ pandas \
64
+ numpy \
65
+ matplotlib \
66
+ seaborn \
67
+ plotly \
68
+ jupyter \
69
+ notebook \
70
+ streamlit \
71
+ gradio \
72
+ opencv-python-headless \
73
+ pillow \
74
+ scikit-learn \
75
+ tensorflow \
76
+ torch \
77
+ transformers \
78
+ openai \
79
+ anthropic \
80
+ langchain \
81
+ chromadb \
82
+ sqlalchemy \
83
+ psycopg2-binary \
84
+ pymongo \
85
+ redis \
86
+ celery \
87
+ pytest \
88
+ black \
89
+ flake8 \
90
+ mypy
91
+
92
+ # Install global npm packages commonly used
93
+ RUN npm install -g \
94
+ create-react-app \
95
+ vue-cli \
96
+ @angular/cli \
97
+ express-generator \
98
+ pm2 \
99
+ nodemon \
100
+ typescript \
101
+ ts-node \
102
+ webpack \
103
+ vite \
104
+ eslint \
105
+ prettier \
106
+ jest \
107
+ mocha \
108
+ cypress \
109
+ playwright \
110
+ @playwright/test
111
+
112
  # Remove the externally-managed-environment file to allow pip installs
113
  RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED
114
 
 
 
 
115
  # Create the working directory and set proper ownership
116
  RUN mkdir -p /animesh && \
117
  chown -R coder:coder /animesh
 
136
  # Upgrade pip in the virtual environment
137
  RUN /home/coder/.venv/bin/pip install --upgrade pip
138
 
139
+ # Set up Chromium for headless browsing (for Selenium/Playwright)
140
+ ENV CHROME_BIN=/usr/bin/chromium-browser
141
+ ENV DISPLAY=:99
142
+
143
+ # Create a script to start Xvfb in the background
144
+ RUN echo '#!/bin/bash\nXvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &' > /home/coder/start-xvfb.sh && \
145
+ chmod +x /home/coder/start-xvfb.sh
146
+
147
  # Set the working directory
148
  WORKDIR /animesh
149
 
150
  # Expose port for Hugging Face Spaces
151
  EXPOSE 7860
152
 
153
+ # Start Xvfb and then code-server
154
+ CMD ["/bin/bash", "-c", "/home/coder/start-xvfb.sh && code-server --auth=none --bind-addr 0.0.0.0:7860 /animesh"]