{"id":19522810,"url":"https://github.com/ahmnouira/flask-hello-world","last_synced_at":"2025-04-26T09:32:18.401Z","repository":{"id":40407007,"uuid":"200587820","full_name":"ahmnouira/flask-hello-world","owner":"ahmnouira","description":"This is a simple flask application designed to run in multiple ways: locally docker container from docker hub hosted by IBM cloud.","archived":false,"fork":false,"pushed_at":"2023-12-15T08:55:19.000Z","size":177,"stargazers_count":5,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T10:40:05.129Z","etag":null,"topics":["bluemix","cloud","cloud-foundry","docker","docker-container","doker-hub","flask","flask-application","flask-docker","flask-dockerfile","hello-world","helloworld","ibm-cloud","python","python-docker","standalone"],"latest_commit_sha":null,"homepage":"http://flask-hello-world.eu-gb.mybluemix.net","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/ahmnouira.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":"2019-08-05T05:26:49.000Z","updated_at":"2024-04-12T12:40:25.000Z","dependencies_parsed_at":"2023-12-15T09:44:52.356Z","dependency_job_id":"1e685b80-c454-4f40-b215-c520bf7af4f9","html_url":"https://github.com/ahmnouira/flask-hello-world","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmnouira%2Fflask-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmnouira%2Fflask-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmnouira%2Fflask-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmnouira%2Fflask-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmnouira","download_url":"https://codeload.github.com/ahmnouira/flask-hello-world/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250967348,"owners_count":21515582,"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":["bluemix","cloud","cloud-foundry","docker","docker-container","doker-hub","flask","flask-application","flask-docker","flask-dockerfile","hello-world","helloworld","ibm-cloud","python","python-docker","standalone"],"created_at":"2024-11-11T00:40:59.657Z","updated_at":"2025-04-26T09:32:17.865Z","avatar_url":"https://github.com/ahmnouira.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flask-hello-world\n\nThis is a simple flask application\n\n## Overview\n\n![hello_ahmed](/img/hello_ahmed.png)\n\n## Running this app\n\nThis app is designed to run in different ways:\n\n1. As a standalone app running on your machine\n2. As a Docker container running locally\n3. As a Docker image published in Docker Hub\n4. As an application hosted by [IBM Cloud](https://https://www.ibm.com/cloud)\n\n## 1. As a standalone app\n\n1. install [python](https://www.python.org/)\n2. `git clone` the project then `cd` into the directory\n3. run `virtualenv -p /usr/bin/python3 venv`or `python -m venv venv` to create a virtual environment\n4. activate it using `source venv/bin/activate`\n5. `pip install -r requirements.txt` to install the app libraries and it dependencies\n\n### running the app\n\nAfter installing, run the server using `python app.py`\nAccess the running app in a browser at the URL written to the console (most likely [http://localhost:5000](http://localhost:50000))\n\n## 2. As a Docker container running on your machine\n\n1. install [Docker](https://www.docker.com/)\n2. `run docker --version` to check if docker is installed\n3. run `docker build -t flask-hello-world:latest .` to build the docker image\n4. `docker images` list the local available images\n5. run `docker run --name flask_hello_world -d -p 8000:5000 --rm flask-hello-world:latest` to start the container\n6. Navigate to [http://localhost:8000](http://localhost:8000) in a browser to see the results. If you want to share it with your local network devices navigate to *http://[your-ip-address]:8000*\n\n## 3. As a Docker image published in Docker Hub\n\nDocker Hub is a free service to publicly store available images.\n\n1. you need to install only [Docker](https://www.docker.com/)\n2. just run `docker run -d -p 8080:5000 --name flask ahmnouira/flask-hello-world`\n\n![my_docker_hub](/img/docker_hub.png)\n\n## 4. As an application hosted by IBM Cloud\n\n :octocat: Before you begin, verify that you have completed the below steps:\n\n* you have access to an [IBM Cloud account](https://cloud.ibm.com/registration).\n* the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cloud-cli-getting-started) is installed in your workstation.\n\n1. clone the repository by running  `git clone https://github.com/AhmNouira/flask-hello-world`\n2. `cd flask-hello-world`\n3. run `bx login` to login to your IBM cloud account and enter your email and password\n4. `bx target --cf` to target the Cloud Foundry\nTo check the default organization and space to which you have access, go to \u003chttps://cloud.ibm.com/account/cloud-foundry\u003e.\n5. `bx cf push` to push the application to IBM Cloud\n6. if you found any error run `bx cf logs flask-hello-world --recent` to see the troubleshoot\n7. check whether your app is running `bx cf app flask-hello-world`\n8. to explore how your app directories are structured `bx cf ssh flask-hello-world`\n\n![ibm_cloud](/img/ibm_cloud.png)\n\n## 5. Push a new image\n\nLogin to the docker.io using the access token\n\n```bash\ndocker login -u ahmnouira docker.io     \n```\n\nBuild and tag\n\n```bash\ndocker build -t flask-hello-world:latest .\n```\n\nTag it as per the docker hub repository name\n\n```bash\ndocker tag flask-hello-world:latest ahmnouira/flask-hello-world:latest\n```\n\nPush the a new image:\n\n```bash\ndocker image push ahmnouira/flask-hello-world:latest  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmnouira%2Fflask-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmnouira%2Fflask-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmnouira%2Fflask-hello-world/lists"}