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"] 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: 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 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