set up wsgi/flask option in backend

This commit is contained in:
finn 2024-07-30 12:58:32 +00:00
parent 4bec4e9671
commit 9b79a3796b
4 changed files with 5 additions and 8 deletions

View File

@ -8,7 +8,7 @@ RUN target=/root/.cache/pip \
COPY . .
ENV FLASK_APP giapp.py
ENV FLASK_APP app.py
# This might be scary to leave on
#ENV FLASK_ENV development

View File

@ -11,12 +11,9 @@ class DBManager:
#printf("DEBUG:" + envuser + envpass)
self.connection = mysql.connector.connect(
user=envuser,
#user=user,
password=envpass,
#password=password,
host=host, # name of the mysql service as set in the docker compose file
database=database
#auth_plugin='mysql_native_password'
)
self.cursor = self.connection.cursor()
@ -46,9 +43,6 @@ def listBlog():
rec = conn.query_titles()
response = ''
ict = ''
arg1 = ''
arg2 = ''
for c in rec:
response = response + '<div> Log: ' + c + '</div>'
@ -58,7 +52,7 @@ def listBlog():
response = response + '<div>Delta: ' + dtFormatted + '</div>'
return response
@server.route('/args-test', methods=['GET'])
@server.route('/inconsequential-auth', methods=['GET'])
def listArgs():
good_token_i = str(os.getenv("TOKEN_I"))

View File

@ -1,3 +1,4 @@
Flask==3.0.3
Werkzeug==3.0.3
mysql-connector-python
pyuwsgi

View File

@ -27,6 +27,8 @@ services:
context: backend
target: builder
restart: always
# Comment following line to use flask (1worker, dev), uncomment to use uwsgi (wsgi)
command: ["uwsgi", "--http", "0.0.0.0:8000", "--master", "-p", "4", "-w", "app:server"]
environment:
- MYSQL_USER=flasku
#- MYSQL_PASSWORD=flaskp