From b94807b55ccbf6c7cec4704dbb066fa88a904be6 Mon Sep 17 00:00:00 2001 From: AnastasiosLouka Date: Sun, 8 Oct 2023 21:48:10 +0300 Subject: [PATCH 1/4] Create docker image --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e97fcd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3 +WORKDIR /simple_api +COPY /requirements.txt /simple_api +RUN pip install -r requirements.txt +COPY . /simple_api +EXPOSE 5000 +CMD ["python", "/.simple_api"] \ No newline at end of file From d339bba9023eec71a24379d455c86dd3ed50775b Mon Sep 17 00:00:00 2001 From: AnastasiosLouka Date: Sun, 8 Oct 2023 21:48:29 +0300 Subject: [PATCH 2/4] Fixes --- app/routes.py | 2 +- config/config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index 041d527..9170420 100644 --- a/app/routes.py +++ b/app/routes.py @@ -82,7 +82,7 @@ def manage_posts(): # Create, Update, Get, Delete one user from db @app.route("/user", methods=["POST"]) -@jwt_required() +# @jwt_required() def add_user(): try: data = request.get_json(force=True) diff --git a/config/config.py b/config/config.py index a77d1db..5ee06be 100644 --- a/config/config.py +++ b/config/config.py @@ -5,7 +5,7 @@ class Config(object): SECRET_KEY = os.environ.get("SECRET_KEY") or "you-will-never-guess" - JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY") + JWT_SECRET_KEY = os.environ.get("JWT_SECRET_KEY") or "super" SQLALCHEMY_DATABASE_URI = os.environ.get( "DATABASE_URL" From 85a25aa07a3cedbb910c290bddd3b21aff245116 Mon Sep 17 00:00:00 2001 From: AnastasiosLouka Date: Mon, 9 Oct 2023 23:11:02 +0300 Subject: [PATCH 3/4] Fixes --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e97fcd..7d23912 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3 -WORKDIR /simple_api -COPY /requirements.txt /simple_api +WORKDIR /app +COPY /requirements.txt /app RUN pip install -r requirements.txt -COPY . /simple_api +COPY . /app EXPOSE 5000 -CMD ["python", "/.simple_api"] \ No newline at end of file +CMD ["flask", "run"] \ No newline at end of file From 199d9e7923de0c0b3826fb7085222167f4a147a2 Mon Sep 17 00:00:00 2001 From: thepetk Date: Mon, 9 Oct 2023 21:14:22 +0100 Subject: [PATCH 4/4] Update requirements.txt Signed-off-by: thepetk --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index f82ac68..ffcd741 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ flask +flask_login flask-wtf==1.1.1 flask-sqlalchemy==3.0.3 flask-migrate==4.0.4