This will start a development web server hosting your application, which you will be able to see by navigating to Because port 5000 is the default port for the development server, we didn’t need to specify it. Manually run the installer and application using the following commands: pip install -r requirements.txt Note: When you start writing more advanced Python, you'll find it's not always recommended to use pip install and may want to use virtualenv (or pyenv) to install your dependencies in a virtual environment. The requirements.txt file contains the list of packages needed by the main.py and will be used by pip to install the Flask library. You can learn more about Flask on the Flask website. If you look at the main.py file, you’ll see the application prints out a hello message. There are only two files in this directory. Use git to clone the repository to your local machine: git clone Ĭhange to the app directory: cd hello-python/app Otherwise, you can skip to the "Create a Dockerfile" section. The sample application used is a very simple Flask web application if you want to test it locally, you’ll need Python installed. In this section you’ll take some source code, verify it runs locally, and then create a Docker image of the application.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |