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 backend production server for django #30

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

SouradeepSaha
Copy link
Contributor

No description provided.

Dockerfile.int Outdated
@@ -0,0 +1,11 @@
FROM python:3.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this file to Dockerfile.dev

Dockerfile.int Outdated
RUN pip install -r requirements.txt
COPY . /code/
ENV PATH /code/:$PATH
EXPOSE 8000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to

Suggested change
EXPOSE 8000
EXPOSE $PORT

Since GCP will provide the port number

Dockerfile.prod Outdated
RUN pip install -r requirements.txt
COPY . /code/
ENV PATH /code/:$PATH
EXPOSE 8000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EXPOSE 8000
EXPOSE $PORT

See above

Dockerfile.int Outdated
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install psycopg2-binary==2.8.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not add this to requirements.txt?

Dockerfile.prod Outdated
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install psycopg2-binary==2.8.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not add this to requirements.txt

@@ -0,0 +1,183 @@
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between this file and dev.py?

Comment on lines 82 to 88
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres' if os.getenv("DB_NAME") is None else os.getenv("DB_NAME"),
'USER': 'postgres' if os.getenv("DB_USER") is None else os.getenv("DB_USER"),
'PASSWORD': '1234' if os.getenv("DB_PASS") is None else os.getenv("DB_PASS"),
'HOST': 'db' if os.getenv("DB_HOST") is None else os.getenv("DB_HOST"),
'PORT': '5432' if os.getenv("DB_PORT") is None else os.getenv("DB_PORT"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change these values to match the db config in our current settings.py file? We migrated from postgres to oracle

Comment on lines 100 to 105
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres' if os.getenv("DB_NAME") is None else os.getenv("DB_NAME"),
'USER': 'postgres' if os.getenv("DB_USER") is None else os.getenv("DB_USER"),
'PASSWORD': '1234' if os.getenv("DB_PASS") is None else os.getenv("DB_PASS"),
'HOST': 'db' if os.getenv("DB_HOST") is None else os.getenv("DB_HOST"),
'PORT': '5432' if os.getenv("DB_PORT") is None else os.getenv("DB_PORT"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Comment on lines 101 to 106
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres' if os.getenv("DB_NAME") is None else os.getenv("DB_NAME"),
'USER': 'postgres' if os.getenv("DB_USER") is None else os.getenv("DB_USER"),
'PASSWORD': '1234' if os.getenv("DB_PASS") is None else os.getenv("DB_PASS"),
'HOST': 'db' if os.getenv("DB_HOST") is None else os.getenv("DB_HOST"),
'PORT': '5432' if os.getenv("DB_PORT") is None else os.getenv("DB_PORT"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Comment on lines +101 to +106
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres' if os.getenv("DB_NAME") is None else os.getenv("DB_NAME"),
'USER': 'postgres' if os.getenv("DB_USER") is None else os.getenv("DB_USER"),
'PASSWORD': '1234' if os.getenv("DB_PASS") is None else os.getenv("DB_PASS"),
'HOST': 'db' if os.getenv("DB_HOST") is None else os.getenv("DB_HOST"),
'PORT': '5432' if os.getenv("DB_PORT") is None else os.getenv("DB_PORT"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants