Skip to content

Commit

Permalink
changed structure for flask app
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvi Shankar committed Feb 27, 2017
1 parent 1f57abd commit 0201753
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions python-flask/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ WORKDIR /usr/src/app
# install requirements
# this way when you build you won't need to install again
# and since COPY is cached we don't need to wait
COPY requirements.txt /tmp/requirements.txt
COPY ./app/src/requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt

COPY app /usr/src/app

# App port number is configured through the gunicorn config file
CMD ["gunicorn", "--config", "gunicorn_config.py", "server:app"]
CMD ["gunicorn", "--config", "./conf/gunicorn_config.py", "src:app"]
File renamed without changes.
13 changes: 0 additions & 13 deletions python-flask/app/server.py

This file was deleted.

6 changes: 6 additions & 0 deletions python-flask/app/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from flask import Flask


app = Flask(__name__)

from .server import *
File renamed without changes.
9 changes: 9 additions & 0 deletions python-flask/app/src/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from src import app
from flask import jsonify, request
import requests
import json


@app.route("/")
def hello():
return json.dumps({"message":"Hello World!"})

0 comments on commit 0201753

Please sign in to comment.