FROM python:3.10-slim # Install necessary system dependencies RUN apt-get update && apt-get install -y \ build-essential \ git \ wget \ && apt-get clean # Install Gotty (GoTTY) v1.5.0 RUN wget -O /usr/local/bin/gotty https://github.com/sorenisanerd/gotty/ && \ chmod +x /usr/local/bin/gotty # Copy requirements first to leverage Docker layer caching COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt # Copy the rest of the application code COPY . /app WORKDIR /app # Expose a port for the container (for Gotty to use) EXPOSE 7860 # Set Gotty to serve the Textual application CMD ["gotty", "-w", "--reconnect", "--port", "${PORT:-7860}", "python", "-m", "textual", "run", "JSONEditorApp"]