I have designed and implemented AI and software solutions for major clients such as the European Commission, Eurostat, IMF, the European Central Bank, OECD, and IKEA. My name is Dimitris Poulopoulos, and I’m a machine learning engineer working for Arrikto. You’ll hear from me every Friday with updates and thoughts on the latest AI news, research, repos and books. Learning Rate is my weekly newsletter for those who are curious about the world of AI and MLOps. To dive deeper check out the working with containers topic on the Visual Studio Code documentation site to get started. In this story, we explored the Docker extension for VS Code and how it can help us compose a Dockerfile, build an image and deploy it. Hit F5 or press the play button to attach the debugger. Set a breakpoint in the chosen file, navigate to Run and Debug and select the Python: Remote Attach launch configuration.ħ. Start the container by right-clicking on a docker-compose.yml file and selecting Compose Up.Ħ. A terminal will open and your image will be ready in a matter of seconds.ĥ. Now, to build the image, right-click on the generated Dockerfile and choose Build Image. Finally, choose the python file holding the Flask application (the code provided above) and the port you would like to expose ( 5000 is the default). Choose yes this way you will be able to debug the application running inside the container later. Select the Python: Flask option for the first question and then, the extension will ask you if you would like to include the optional Docker compose files. To create a Dockerfile and everything else you need just run Docker: Add Docker Files to Workspace in the command palette ( ctlr+shift+p in windows). Next, we need a requirements.txt file to hold the dependencies and we are ready to go: Flask=1.1.2 gunicorn It just returns “ Hello World” whenever you hit the root endpoint. If you are familiar with Flask, you can see that this is the simplest application you can implement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |