diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bc39015 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.12-bookworm + +WORKDIR /app + +COPY ./requirements.txt /app/requirements.txt + +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt + +COPY . /app + +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/models.py b/models.py index 76fe029..93408dd 100644 --- a/models.py +++ b/models.py @@ -61,7 +61,7 @@ SQLITE_FILE_NAME = "database.db" DATABASE_URL = f"sqlite:///{SQLITE_FILE_NAME}" connect_args = {"check_same_thread": False} -engine = create_engine(DATABASE_URL, echo=True, connect_args=connect_args) +engine = create_engine(DATABASE_URL, connect_args=connect_args) def create_db_and_tables(): diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0206494 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,26 @@ +annotated-types==0.6.0 +anyio==4.3.0 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +cffi==1.16.0 +click==8.1.7 +fastapi==0.110.1 +greenlet==3.0.3 +h11==0.14.0 +httptools==0.6.1 +idna==3.7 +passlib==1.7.4 +pycparser==2.22 +pydantic==2.6.4 +pydantic_core==2.16.3 +python-dotenv==1.0.1 +PyYAML==6.0.1 +sniffio==1.3.1 +SQLAlchemy==2.0.29 +sqlmodel==0.0.16 +starlette==0.37.2 +typing_extensions==4.11.0 +uvicorn==0.29.0 +uvloop==0.19.0 +watchfiles==0.21.0 +websockets==12.0 diff --git a/security.py b/security.py index 6629f2f..83ffce3 100644 --- a/security.py +++ b/security.py @@ -1,11 +1,9 @@ -from passlib.context import CryptContext - -pwd_context = CryptContext(schemes=["argon2"]) +from passlib.hash import argon2 def hash_password(password: str | bytes): - return pwd_context.hash(password) + return argon2.hash(password) def verify_password(password: str | bytes, hashed_password: str): - return pwd_context.verify(password, hashed_password) + return argon2.verify(password, hashed_password)