File size: 1,087 Bytes
a4b51f5
 
c5747fb
 
 
 
a4b51f5
 
c5747fb
a4b51f5
 
 
c5747fb
a4b51f5
 
c5747fb
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.11-slim

# Install wget (optional, you can use curl instead)
RUN apt-get update && apt-get install -y wget

# Set the working directory
WORKDIR /app

# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY app.py .

# Download and install OpenVSCode Server
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 && \
    tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
    rm /tmp/openvscode-server.tar.gz && \
    mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
    chown -R 1000:1000 /opt/openvscode-server

# Expose ports for OpenVSCode Server and your application
EXPOSE 3000  # OpenVSCode Server
EXPOSE 8080  # Your Python application (adjust if needed)

# Start OpenVSCode Server and your Python application
CMD ["sh", "-c", "/opt/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 3000 & python app.py"]