Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create nginx-pod.yml #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend_main_django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions dos2unix.py
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 10 additions & 0 deletions nginx-pod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx-container
image: nginx:1.25.1
ports:
- containerPort: 80