From 5315e24512a15f85b53728e588f91f699575dd7f Mon Sep 17 00:00:00 2001 From: nithyanandharajms138-debug Date: Sat, 8 Nov 2025 10:28:45 +0000 Subject: [PATCH] Manual docker setup --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ app.py | 2 ++ 2 files changed, 53 insertions(+) diff --git a/README.md b/README.md index 0349143d..83fed837 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,57 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +##🐳 Running Without VS Code (Manual Docker Setup) +This project is designed for use with VS Code Dev Containers, but you can also run it manually using Docker without VS Code. + +🔧 Prerequisites +Docker installed and running + +Ensure the Docker daemon is active (sudo systemctl start docker or sudo snap start docker depending on your install method) + +▶️ Manual Run Instructions +Clone the repository + +bash +git clone https://github.com/microsoft/vscode-remote-try-python.git +cd vscode-remote-try-python +Ensure Flask is configured to expose the server Update app.py to include: + +python +if __name__ == "__main__": + app.run(host="0.0.0.0", port=5000) +Run the container + +bash +sudo docker run -it --rm \ + -v $(pwd):/workspace \ + -w /workspace \ + -p 5000:5000 \ + mcr.microsoft.com/devcontainers/python:1-3.12 bash +Install dependencies and start the app Inside the container: + +bash +pip3 install -r requirements.txt +python3 app.py +Open your browser Visit http://localhost:5000 to view the app. + +🛠 Troubleshooting +Docker not found If docker: command not found, ensure Docker is installed and added to your system PATH. + +Docker daemon not running If you see Cannot connect to the Docker daemon, start it with: + +bash +sudo systemctl start docker +# or, if installed via Snap: +sudo snap start docker +Empty browser response (ERR_EMPTY_RESPONSE) Ensure: + +app.py uses host="0.0.0.0" so Docker can expose the port + +You're visiting the correct port (5000) + +The container is running and python3 app.py is active + ## License Copyright © Microsoft Corporation All rights reserved.
diff --git a/app.py b/app.py index 8c27ec75..60d3cca0 100644 --- a/app.py +++ b/app.py @@ -9,3 +9,5 @@ @app.route("/") def hello(): return app.send_static_file("index.html") + +app.run('0.0.0.0',port=7000)