{"id":17982678,"url":"https://github.com/starlord-daniel/flask-rest","last_synced_at":"2025-03-25T19:31:37.290Z","repository":{"id":111777596,"uuid":"112846912","full_name":"starlord-daniel/flask-rest","owner":"starlord-daniel","description":"A RESTful service based on the Flask Python framework","archived":false,"fork":false,"pushed_at":"2018-06-26T06:59:36.000Z","size":77,"stargazers_count":4,"open_issues_count":0,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-20T17:38:31.979Z","etag":null,"topics":["azure","azure-cli","azure-cognitive-services","containers","docker","flask","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/starlord-daniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-02T14:06:40.000Z","updated_at":"2023-09-11T18:58:10.000Z","dependencies_parsed_at":"2023-04-20T00:44:13.170Z","dependency_job_id":null,"html_url":"https://github.com/starlord-daniel/flask-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlord-daniel%2Fflask-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlord-daniel%2Fflask-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlord-daniel%2Fflask-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starlord-daniel%2Fflask-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starlord-daniel","download_url":"https://codeload.github.com/starlord-daniel/flask-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245530247,"owners_count":20630515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-cli","azure-cognitive-services","containers","docker","flask","python"],"created_at":"2024-10-29T18:14:50.429Z","updated_at":"2025-03-25T19:31:37.284Z","avatar_url":"https://github.com/starlord-daniel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flask-rest\nA RESTful service based on the Flask Python framework\n\n\u003ca href=\"http://flask.pocoo.org/\"\u003e\u003cimg src=\"images/flask-python.jpg\" width=600 style=\"margin: auto; display: block;\"/\u003e\u003c/a\u003e\n\n## Docker Container \n\n\u003ca href=\"https://www.docker.com/what-docker\"\u003e\u003cimg src=\"images/docker.png\" width=600 style=\"margin: auto; display: block;\" /\u003e\u003c/a\u003e\n\nThis setup requires Docker to run on your PC. I've used Windows and Powershell to run the commands. You can find the downloads for [Windows](https://www.docker.com/docker-windows) and [Mac](https://www.docker.com/docker-mac) at the respective links. \n\nThe Create an image from the Flask service and run it and upload it as a web service, follow these steps:\n\n### Build the image by running:\n```docker\ndocker build -t \u003cimage-name\u003e .\n```\n\nWhere -t is used to set the tag for the image to create. The dot (.) at the end refers to the file path of the Dockerfile. For the build to work, the whole path can't contain any spaces. Something like C:\\test would be fine, but \"C:\\test\\this app\" wouldn't be.\n\nAn example: \n\n```docker\ndocker build -t flask-rest .\n```\n\n### Run the container locally:\n```docker\ndocker run -p 8000:8000 \u003cimage-name\u003e\n```\n\nThe property -p sets the port mapping for the container. As the script exposes port 8000, this should be mapped to another port of the container. You might change the second value (right) to change the port to speak to. \n\nAn example: \n\n```docker\ndocker run -p 8000:8000 flask-rest\n```\n\n### **[Option 1/2]** Upload image to Docker Hub:\n\n1. Login to docker from command line\n\n    ```docker\n    docker login --username \u003cdocker-id\u003e --password \u003cdocker-hub-password\u003e\n    ```\n\n    It is more secure, to use --password-stdin to login to your docker account:\n\n    ```docker\n    $ cat ~/my_password.txt | docker login --username foo --password-stdin\n    ```\n\n    More information can be found in the [Docker Docs](https://docs.docker.com/engine/reference/commandline/login/#parent-command)\n\n2. Push the image to Docker Hub:\n    ```docker\n    docker push \u003cdocker-id\u003e/\u003cname-of-image\u003e:v1.0.0 .\n    ```\n\n### **[Option 2/2]** Upload image to Azure Container Registry\n\n0. Prepare for upload:\n\n    ```shell\n    pip install --user azure-cli\n    ```\n    \n    If this doesn't work, download the installer and follow the instructions up on [Azure Docs](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)\n\n1. Login to your container registry:\n\n    ```docker \n    docker login \u003cacr-name\u003e.azurecr.io \n    ```\n\n2. Push to your registry:\n\n    ```docker \n    docker tag \u003cimage-name\u003e \u003cacr-name\u003e.azurecr.io/\u003crepo-name\u003e\n    docker push awesome.azurecr.io/\u003crepo-name\u003e\n    ```\n\n    More info in the [Azure Docs](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-docker-cli)\n\n## Create a web service from your Docker image\n\nThis chapter is in development.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlord-daniel%2Fflask-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarlord-daniel%2Fflask-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlord-daniel%2Fflask-rest/lists"}