likhonsheikh commited on
Commit
54d1d4d
·
verified ·
1 Parent(s): 8d2cc53

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -24
Dockerfile CHANGED
@@ -1,18 +1,14 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
6
- # Install code-server and other dependencies
 
 
 
7
  RUN apt-get update && apt-get install -y \
8
- curl \
9
- wget \
10
  git \
11
  nodejs \
12
  npm \
13
- supervisor \
14
- && curl -fsSL https://code-server.dev/install.sh | sh \
15
- && apt-get clean \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
  RUN useradd -m -u 1000 user
@@ -21,28 +17,21 @@ ENV PATH="/home/user/.local/bin:$PATH"
21
 
22
  WORKDIR /app
23
 
24
- # Copy requirements and install Python dependencies
25
  COPY --chown=user ./requirements.txt requirements.txt
26
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
27
 
28
- # Copy application files
29
  COPY --chown=user . /app
30
 
31
- # Create workspace directory for code-server
32
  RUN mkdir -p /home/user/workspace
 
33
 
34
- # Switch to root to set up supervisor
35
- USER root
36
-
37
- # Create supervisor configuration
38
- RUN mkdir -p /etc/supervisor/conf.d
39
- COPY --chown=root supervisord.conf /etc/supervisor/conf.d/supervisord.conf
40
-
41
- # Switch back to user
42
- USER user
43
 
44
- # Expose port 7860 (HF Spaces standard port)
45
  EXPOSE 7860
46
 
47
- # Start supervisor which will manage both FastAPI and code-server
48
- CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
 
1
+ # Simple approach - just run code-server
 
 
2
  FROM python:3.9
3
 
4
+ # Install code-server
5
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
6
+
7
+ # Install additional tools
8
  RUN apt-get update && apt-get install -y \
 
 
9
  git \
10
  nodejs \
11
  npm \
 
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  RUN useradd -m -u 1000 user
 
17
 
18
  WORKDIR /app
19
 
20
+ # Install Python packages
21
  COPY --chown=user ./requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
+ # Copy your files
25
  COPY --chown=user . /app
26
 
27
+ # Create workspace
28
  RUN mkdir -p /home/user/workspace
29
+ WORKDIR /home/user/workspace
30
 
31
+ # Copy your app files to workspace
32
+ RUN cp -r /app/* . 2>/dev/null || :
 
 
 
 
 
 
 
33
 
 
34
  EXPOSE 7860
35
 
36
+ # Start code-server directly
37
+ CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry", "."]