From e754920002270ab5866ac15851c24f44ad86c579 Mon Sep 17 00:00:00 2001 From: InSung Bahk Date: Thu, 19 Oct 2023 14:02:04 +0900 Subject: [PATCH] Testing: Dockerfile cannot response as correctly --- .gitignore | 2 ++ Dockerfile | 5 +++-- app/main.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6c702b7..fa154d7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ secret_key.json dummy.mp4 extracted_skeleton.json +keys + experiements/ .vscode diff --git a/Dockerfile b/Dockerfile index 21d6aab..51152e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.9 +FROM python:3.10.0-slim-buster WORKDIR /app @@ -16,4 +16,5 @@ RUN export PYTORCH_ENABLE_MPS_FALLBACK=1 ENV SECRET_KEY_FILE=/run/secrets/secret_key.json -CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "error"] +# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "trace", "--ssl-keyfile=./app/keys/private.key", "--ssl-certfile=./app/keys/certificate.crt", "--ws-max-size", "167772160", "--ws-max-queue", "128"] diff --git a/app/main.py b/app/main.py index e550b71..e95a811 100644 --- a/app/main.py +++ b/app/main.py @@ -3,7 +3,7 @@ from connector import database_connector, database_query from fastapi import FastAPI, File, UploadFile, Form -from fastapi.middleware.cors import CORSMiddleware +from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import PlainTextResponse from fastapi.exceptions import RequestValidationError @@ -16,7 +16,7 @@ EXTRACTOR_THRESHOLD = 0.85 app = FastAPI() -extractor = SkeletonExtractor(pretrained_bool=True, number_of_keypoints=17, device='cpu') +extractor = SkeletonExtractor(pretrained_bool=True, number_of_keypoints=17, device='mps') preprocessor = DataPreprocessing() metrics = Metrics()