Skip to content

Commit

Permalink
Merge pull request #177 from tattle-made/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
duggalsu authored Mar 14, 2024
2 parents 79fb152 + c68596f commit f2a2b3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/.env-template
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ ES_USERNAME=XXXXX
ES_PASSWORD=XXXXX
ES_IMG_INDEX=imgsearch
ES_TXT_INDEX=txtsearch
ES_VID_INDEX=vidsearch
ES_VID_INDEX=vidsearch
WSGI_HOST=XXXXX
WSGI_DEBUG=XXXXX
10 changes: 5 additions & 5 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ EXPOSE 7000
FROM base AS debug
RUN apt-get update && apt-get install -y --no-install-recommends vim zsh jq
RUN pip install --no-cache-dir debugpy nose2
RUN export FLASK_DEBUG=1
USER 999
CMD python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m flask run -h 0.0.0.0 -p 5000
CMD python -m debugpy --listen localhost:5678 --wait-for-client -m flask run --debug -h localhost -p 5000

#### PROD IMAGE ####
FROM base AS prod
USER 999
CMD flask run --host=0.0.0.0
# TODO: Setup production WSGI server - https://flask.palletsprojects.com/en/3.0.x/deploying/index.html
#FROM base AS prod
#USER 999
#CMD flask run --host=0.0.0.0
5 changes: 4 additions & 1 deletion src/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from core.config import ServerConfig
from flask import Flask
from flask_cors import CORS
from os import environ

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -35,4 +36,6 @@ def start(self):
def hello_world():
return "<p>Hello, World!</p>"

self.app.run(host="0.0.0.0", port=self.param.parameters.port, debug=True)
wsgi_host = environ.get("WSGI_HOST")
wsgi_debug = environ.get("WSGI_DEBUG")
self.app.run(host=wsgi_host, port=self.param.parameters.port, debug=wsgi_debug)

0 comments on commit f2a2b3d

Please sign in to comment.