Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -1
Dockerfile
CHANGED
@@ -1,10 +1,28 @@
|
|
1 |
FROM python:3.11-slim
|
2 |
|
|
|
|
|
|
|
|
|
3 |
WORKDIR /app
|
4 |
|
|
|
5 |
COPY requirements.txt .
|
6 |
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
|
|
|
8 |
COPY app.py .
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 # OpenVSCode Server
|
25 |
+
EXPOSE 8080 # Your Python application (adjust if needed)
|
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"]
|