From 236b212b322b0cf37d9e1ab73be8686809446bf7 Mon Sep 17 00:00:00 2001 From: Qiwei Huang Date: Mon, 5 Aug 2024 02:33:55 +0800 Subject: [PATCH] use python --- Dockerfile | 5 +++-- app.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e23c809..b5480d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /app COPY . /app # Install any needed packages specified in requirements.txt -RUN pip install --no-cache-dir flask requests openai opentelemetry-instrumentation-flask waitress +RUN pip install --no-cache-dir flask requests openai opentelemetry-instrumentation-flask # Make port 80 available to the world outside this container EXPOSE 8080 @@ -16,4 +16,5 @@ EXPOSE 8080 # Define environment variable ENV NAME World -CMD [ "waitress-serve", "--call", "app:app"] \ No newline at end of file +# Run main.py when the container launches +CMD [ "python3", "-m" , "flask", "run", "--port=8080"] \ No newline at end of file diff --git a/app.py b/app.py index 012043d..17ad866 100644 --- a/app.py +++ b/app.py @@ -142,4 +142,4 @@ def get_models(): raise ValueError("MODEL_MAPPER and RESOURCE_MAPPER environment variables must be set") if os.getenv('KEYS_MAPPER') is None: raise ValueError("KEYS_MAPPER environment variable must be set") - app.run(host='0.0.0.0', port=8081, debug=True) + app.run(host='0.0.0.0', port=8080, debug=True)