diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f612741da1..cdb18e8931 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,6 +45,9 @@ jobs: git pull + touch .env + echo "${{ secrets.ENV }}" > .env + docker stop maru-rec-sys-container docker rm maru-rec-sys-container diff --git a/__pycache__/main.cpython-310.pyc b/__pycache__/main.cpython-310.pyc index 25da000c53..74579e9fb9 100644 Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ diff --git a/main.py b/main.py index fbaec9d1c9..675cb42e9e 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,8 @@ from sklearn.impute import SimpleImputer from request import Recommend +import os + state_lock = Lock() @@ -50,7 +52,7 @@ class DataModel(BaseModel): user: UserCategory post: PostCategory -DATABASE_URL = "postgresql://cheesecrust:0810jack@mydatabase.c3kmc4wcyz81.ap-northeast-2.rds.amazonaws.com/maru" +DATABASE_URL = f"postgresql://{os.getenv('DB_USER')}:{os.getenv('DB_PASSWORD')}@{os.getenv('DB_HOST')}:{os.getenv('DB_PORT')}/{os.getenv('DB_NAME')}" # DATABASE_URL = "postgresql://localhost:5432/maru" database = Database(DATABASE_URL) @@ -182,7 +184,7 @@ async def fetch_data(user_id, card_type, want_to_find): user_location = "성북구" if user['location'] != 'default': - user['location'].split()[1] + user_location = user['location'].split()[1] user_gender = user['gender']