miike-ai commited on
Commit
e388c47
·
verified ·
1 Parent(s): 718fcd1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -2,8 +2,9 @@ FROM ubuntu:22.04
2
 
3
  # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive
 
5
 
6
- # Install dependencies, code-server, and ollama without sudo in the initial list
7
  RUN apt-get update && \
8
  apt-get install -y curl wget gpg apt-transport-https git nodejs npm python3 python3-pip && \
9
  curl -fsSL https://code-server.dev/install.sh | sh && \
@@ -13,13 +14,13 @@ RUN apt-get update && \
13
  # Create a directory for the workspace
14
  RUN mkdir -p /workspace
15
 
16
- # Create configuration directory
17
- RUN mkdir -p /root/.config/code-server
18
 
19
  # Configure code-server to run on port 7860 (Hugging Face Spaces default)
20
  RUN echo "bind-addr: 0.0.0.0:7860\nauth: none\ncert: false" > /root/.config/code-server/config.yaml
21
 
22
- # Install ollama after code-server is set up
23
  RUN curl -fsSL https://ollama.com/install.sh | sh || true
24
 
25
  # Install some useful VS Code extensions
@@ -29,10 +30,10 @@ RUN code-server --install-extension ms-python.python && \
29
 
30
  # Create a startup script
31
  RUN echo '#!/bin/bash\n\
32
- # Start ollama in the background\n\
33
  /usr/local/bin/ollama serve &\n\
34
  \n\
35
- # Give ollama a moment to start\n\
36
  sleep 2\n\
37
  \n\
38
  # Start code-server in the foreground\n\
@@ -47,4 +48,4 @@ EXPOSE 7860 11434
47
  WORKDIR /workspace
48
 
49
  # Start both services
50
- CMD ["/start.sh"]
 
2
 
3
  # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV HOME=/root
6
 
7
+ # Install dependencies, code-server, and Ollama
8
  RUN apt-get update && \
9
  apt-get install -y curl wget gpg apt-transport-https git nodejs npm python3 python3-pip && \
10
  curl -fsSL https://code-server.dev/install.sh | sh && \
 
14
  # Create a directory for the workspace
15
  RUN mkdir -p /workspace
16
 
17
+ # Create configuration directory for code-server and Ollama
18
+ RUN mkdir -p /root/.config/code-server /root/.ollama
19
 
20
  # Configure code-server to run on port 7860 (Hugging Face Spaces default)
21
  RUN echo "bind-addr: 0.0.0.0:7860\nauth: none\ncert: false" > /root/.config/code-server/config.yaml
22
 
23
+ # Install Ollama after code-server is set up
24
  RUN curl -fsSL https://ollama.com/install.sh | sh || true
25
 
26
  # Install some useful VS Code extensions
 
30
 
31
  # Create a startup script
32
  RUN echo '#!/bin/bash\n\
33
+ # Start Ollama in the background\n\
34
  /usr/local/bin/ollama serve &\n\
35
  \n\
36
+ # Give Ollama a moment to start\n\
37
  sleep 2\n\
38
  \n\
39
  # Start code-server in the foreground\n\
 
48
  WORKDIR /workspace
49
 
50
  # Start both services
51
+ CMD ["/start.sh"]