From f2153e0ea8a2c32c82c34c799c3a6d9627943c42 Mon Sep 17 00:00:00 2001 From: DimitryRukhadze Date: Thu, 20 Jul 2023 18:21:12 +0300 Subject: [PATCH 1/4] Create nginx-pod.yml --- nginx-pod.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 nginx-pod.yml diff --git a/nginx-pod.yml b/nginx-pod.yml new file mode 100644 index 0000000..cc429cf --- /dev/null +++ b/nginx-pod.yml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx +spec: + containers: + - name: nginx-container + image: nginx:1.25.1 + ports: + - containerPort: 80 \ No newline at end of file From 2e56e1cf80ed352c3b804587970082f827227780 Mon Sep 17 00:00:00 2001 From: DimitryRukhadze Date: Thu, 20 Jul 2023 18:25:11 +0300 Subject: [PATCH 2/4] Changed debug mode --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index aa73e34..b6addd4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,9 +15,9 @@ services: image: django_app volumes: - ./backend_main_django:/code - environment: + environment: SECRET_KEY: ${WEB_SECRET_KEY-REPLACE_ME} - DEBUG: ${WEB_DEBUG-TRUE} + DEBUG: ${WEB_DEBUG-FALSE} DATABASE_URL: ${WEB_DATABASE_URL-postgres://test_k8s:OwOtBep9Frut@db:5432/test_k8s} ALLOWED_HOSTS: ${WEB_ALLOWED_HOSTS-127.0.0.1,localhost} ports: From 8e399cc9e39360e5786a44b38400006329ac1a5c Mon Sep 17 00:00:00 2001 From: DimitryRukhadze Date: Thu, 20 Jul 2023 18:25:42 +0300 Subject: [PATCH 3/4] added dos2unix script --- dos2unix.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 dos2unix.py diff --git a/dos2unix.py b/dos2unix.py new file mode 100644 index 0000000..7d80852 --- /dev/null +++ b/dos2unix.py @@ -0,0 +1,12 @@ +import os +from pydos2unix import dos2unix + +base_dir = 'backend_main_django' +filename = os.path.join(base_dir, input()) + +buffer = '' +with open(filename, 'rb') as file: + buffer = dos2unix(file) + +with open(filename, 'wb') as file: + file.write(buffer) \ No newline at end of file From eb01e95eace324ca0da28bda49ebed069e5494f1 Mon Sep 17 00:00:00 2001 From: DimitryRukhadze Date: Thu, 20 Jul 2023 18:27:10 +0300 Subject: [PATCH 4/4] deleted empty secret key --- backend_main_django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend_main_django/Dockerfile b/backend_main_django/Dockerfile index 2a3508f..c070b82 100644 --- a/backend_main_django/Dockerfile +++ b/backend_main_django/Dockerfile @@ -11,6 +11,6 @@ RUN apt update && apt install -y python3-pip \ && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/*.list COPY unit_config.json /docker-entrypoint.d/ COPY . /code/ -RUN SECRET_KEY=empty python manage.py collectstatic --noinput +RUN python manage.py collectstatic --noinput EXPOSE 80 VOLUME ["/media"]