-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Create backend production server for django #30
Conversation
Dockerfile.int
Outdated
@@ -0,0 +1,11 @@ | |||
FROM python:3.7 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
uwpath_backend/int.py
Outdated
@@ -0,0 +1,183 @@ | |||
""" |
There was a problem hiding this comment.
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?
uwpath_backend/dev.py
Outdated
'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"), |
There was a problem hiding this comment.
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
uwpath_backend/int.py
Outdated
'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"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
uwpath_backend/prod.py
Outdated
'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"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
'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"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
No description provided.