Skip to content

Commit

Permalink
ship it
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 29, 2024
1 parent d0ff12c commit 4a0f04c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 2 additions & 5 deletions labapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ WORKDIR /app
COPY app .
RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000
ENV FLASK_APP app.py
ENV FLASK_RUN_HOST 0.0.0.0

CMD ["flask", "run", "--host=0.0.0.0"]
EXPOSE 8080
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
1 change: 1 addition & 0 deletions labapp/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 3 additions & 3 deletions labapp/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ce import get_ce_info, get_ce_state

app = Flask(__name__)
app.config['udf'] = os.getenv('UDF', False)
app.config['udf'] = os.getenv('UDF', None)
info = None
if app.config['udf']:
info = get_ce_info()
Expand Down Expand Up @@ -141,6 +141,6 @@ def lb_azure():
return jsonify(status='success', data=response.json())
except requests.RequestException as e:
return jsonify(status='fail', error=str(e))

if __name__ == '__main__':
app.run(debug=False)
app.run(host='0.0.0.0', port=5001, debug=False)
3 changes: 2 additions & 1 deletion labapp/app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Markdown ~=3.6
validators ~=0.28.1
boto3 ~=1.34.92
pyYAML ~=6.0.1
Flask-Caching ~=2.1.0
Flask-Caching ~=2.1.0
gunicorn ~=22.0.0

0 comments on commit 4a0f04c

Please sign in to comment.