From d685f1acce84f6775dee8e24989420f9b2d259c0 Mon Sep 17 00:00:00 2001 From: Vadym Voitiuk Date: Thu, 11 Apr 2024 11:50:10 +0200 Subject: [PATCH 1/4] Added doecker related commands to Makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 3485be1d..928a90d8 100644 --- a/Makefile +++ b/Makefile @@ -37,3 +37,12 @@ test: clear_cache: python manage.py clear_cache + +docker-build: + docker build -t swapi . + +docker-run: + docker run -p8000:8000 --name swapi-local-container --rm swapi + +docker-kill: + docker kill swapi-local-container From ef45b536807418dcb2ec10918ce158b73af52eea Mon Sep 17 00:00:00 2001 From: Vadym Voitiuk Date: Thu, 11 Apr 2024 11:55:50 +0200 Subject: [PATCH 2/4] Added new make tasks to a readme --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5cec846..b2cf502e 100644 --- a/README.md +++ b/README.md @@ -12,5 +12,20 @@ An "unofficial" branch of "swapi", supported by @juriy ## Will it be updated? -Original swapi project is built on Python/Django stack that is quite outdated by now. It would be a great exercise to rewrite it in cloud-native manner, but this requires time and effort. I'm looking into doing that. There's no timelines yet, since "swapi" stopped its existence quite suddenly. Suggestions and help are always welcome! +Original swapi project is built on Python/Django stack that is quite outdated by now. +It would be a great exercise to rewrite it in cloud-native manner, but this requires time and effort. I'm looking into doing that. There's no timelines yet, since "swapi" stopped its existence quite suddenly. Suggestions and help are always welcome! + +## How to run it? +The easiest way to run swapi – via docker + +``` +# Ruilding the image +make docker-build + +# Running the container +make docker-run + +# Kill the running container +make docker-kill +``` From 8faffd9f05e820a38d95ebd521e1a0c05521c367 Mon Sep 17 00:00:00 2001 From: Vadym Voitiuk Date: Thu, 11 Apr 2024 12:09:44 +0200 Subject: [PATCH 3/4] Added code syntax highlighting for better readability --- swapi/templates/base.html | 5 +++++ swapi/templates/index.html | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/swapi/templates/base.html b/swapi/templates/base.html index 458e541f..efed2b0a 100644 --- a/swapi/templates/base.html +++ b/swapi/templates/base.html @@ -11,6 +11,8 @@ + + @@ -22,6 +24,9 @@ gtag('js', new Date()); gtag('config', 'UA-163610532-1'); + + +