Skip to content

Commit

Permalink
add IBM Cloud host
Browse files Browse the repository at this point in the history
v2.0
  • Loading branch information
ahmnouira committed Aug 7, 2019
1 parent 52f98e7 commit 7743fca
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 0 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified Dockerfile
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app --log-file -
17 changes: 17 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This app is designed to run in different ways:
1. As a standalone app running on your machine
2. As a Docker container running locally
3. As a Docker image published in Docker Hub
4. As an application hosted by [IBM Cloud](https://https://www.ibm.com/cloud)

## 1. As a standalone app

Expand Down Expand Up @@ -37,5 +38,21 @@ Access the running app in a browser at the URL written to the console (most like
Docker Hub is a free service to publicly store available images.
1. you need to install only [Docker](https://www.docker.com/)
2. just run `docker run -d -p 8080:5000 --name flask ahmnouira/flask-hello-world`

![my_doker_hub](/img/docker_hub.png)

## 4. As an application hosted by IBM Cloud
:octocat: Befor you begin:

* [IBM Cloud account](https://cloud.ibm.com/registration)
* install [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cloud-cli-getting-started) by running `curl -sL https://ibm.biz/idt-installer | bash`

1. clone the repository by running `git clone https://github.com/AhmNouira/flask-hello-world`
2. `cd flask-hello-world`
2. run `bx login` to login to your IBM cloud account and enter your email and password
3. `bx target --cf ` to target the Cloud Foundary
4. `bx cf push` to push the application to IBM Cloud
5. if you found any error run `bx cf logs <your-app-name> --recent ` to see the troubleshoot

![ibm_cloud](/img/ibm_cloud.png)

Empty file modified app.py
100644 → 100755
Empty file.
Empty file modified boot.sh
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions img/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### This folder contains the images for _master_ branch
Empty file modified img/docker_hub.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/hello_ahmed.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ibm_cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
applications:
- path: .
# host: flask-hello-word
random_route: True
name: flask-hello-world
domaine: mybluemix.net
memory: 128M
disk_quota: 128M
Empty file modified requirements/README.md
100644 → 100755
Empty file.
Empty file modified requirements/base.txt
100644 → 100755
Empty file.
Empty file modified requirements/docker.txt
100644 → 100755
Empty file.
32 changes: 32 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Hello World app for running Python apps on Bluemix
"""

# Always prefer setuptools over distutils
from setuptools import setup

# To use a consistent encoding
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='flask-hello-world',
version='1.0.0',
description='Hello World app for running Python apps on Bluemix',
long_description=long_description,
url='https://github.com/AhmNouira/flask-hello-world',
author= 'Ahmed Nouira',
author_email= 'ahmnouira@gmail.com',
license='MIT',
keywords= ['flask', 'hello world'],
install_requires= ['flask', 'gunicorn'],
include_package_data= True,
zip_safe= True,
#entry_points="""[boot.sh]"""
)

0 comments on commit 7743fca

Please sign in to comment.