Public Repository

Last pushed: a year ago
Short Description
flaskbased appliaction
Full Description

Go to your project dir
Create a Dockerfile with:

FROM dghogare/flsk-app:1.0

COPY ./app /app

Create an app directory and enter in it
Create a main.py file (it should be named like that and should be in your app directory) with:

from flask import Flask
app = Flask(name)

@app.route("/")
def hello():
return "Hello World from Flask"

if name == "main":
app.run(host='0.0.0.0', debug=True, port=80)

the main application object should be named app (in the code) as in this example.

Go to the project directory (in where your Dockerfile is, containing your app directory)
Build your Flask image:

docker build -t myflaskapp .

Run a container based on your image:

docker run -d --name myapp -p 80:80 myflaskapp

Docker Pull Command
Owner
dghogare

Comments (0)