Abhaykoul commited on
Commit
39598b4
1 Parent(s): 36a6fd3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -21
Dockerfile CHANGED
@@ -1,28 +1,16 @@
1
- FROM python:3.11-slim
 
2
 
3
- # Install wget (optional, you can use curl instead)
4
- RUN apt-get update && apt-get install -y wget
5
 
6
- # Set the working directory
7
- WORKDIR /app
8
 
9
- # Copy requirements file and install dependencies
10
- COPY requirements.txt .
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy the application code
14
- COPY app.py .
15
 
16
- # Download and install OpenVSCode Server
17
- RUN wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz -O /tmp/openvscode-server.tar.gz && \
18
- tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
19
- rm /tmp/openvscode-server.tar.gz && \
20
- mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
21
- chown -R 1000:1000 /opt/openvscode-server
22
 
23
- # Expose ports for OpenVSCode Server and your application
24
- EXPOSE 3000
25
- EXPOSE 8080
26
 
27
- # Start OpenVSCode Server and your Python application
28
- CMD ["sh", "-c", "/opt/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 3000 & python app.py"]
 
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
+ RUN useradd -m -u 1000 user
 
7
 
8
+ WORKDIR /app
 
 
9
 
10
+ COPY --chown=user ./requirements.txt requirements.txt
 
11
 
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
13
 
14
+ COPY --chown=user . /app
 
 
15
 
16
+ CMD ["python", "app.py"]