cdmahost333 / Dockerfile
zhuhai111's picture
Upload Dockerfile
80e15a7 verified
# Use the scottyhardy/docker-remote-desktop as the base image
FROM scottyhardy/docker-remote-desktop:latest
# Set up environment variables
ENV PYTHONUNBUFFERED=1
# Ensure RDP server is configured properly
ENV RDP_SERVER=yes
ENV DEBIAN_FRONTEND=noninteractive
# Install Python dependencies
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv python3-full && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create a working directory
WORKDIR /app
# Copy application files
COPY main.py /app/
# Create and activate virtual environment
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
# Install Python dependencies in the virtual environment
RUN /app/venv/bin/pip install --no-cache-dir fastapi uvicorn websockets
# Expose both WebSocket tunnel port and RDP port
EXPOSE 7860 3389
# Create startup script to run the WebSocket tunnel only
# Skip trying to start RDP services that require root permissions
RUN echo '#!/bin/bash\n\
echo "Starting WebSocket tunnel service on port 7860..."\n\
echo "Remote desktop service should be available at localhost:3389"\n\
# Start WebSocket tunnel\n\
/app/venv/bin/python /app/main.py\n\
' > /app/start.sh && chmod +x /app/start.sh
# Set the entrypoint to run the startup script
CMD ["/bin/bash", "/app/start.sh"]