Skip to content

Commit

Permalink
Added fixes for nginx and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSteenstra committed Sep 17, 2020
1 parent 02cf167 commit f243201
Show file tree
Hide file tree
Showing 24 changed files with 15,498 additions and 40 deletions.
7 changes: 5 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM python:3.7.7
ENV PYTHONUNBUFFERED 1

ENV SECRET_KEY "4bih3]<ae<'J_quAQyT2q^2-4'csa="
ENV ALLOWED_HOSTS 127.0.0.1, localhost, api
ENV EMAIL_HOST_PASSWORD "lkdafn83nr2N98h3"

RUN mkdir /backend
WORKDIR /backend
COPY requirements.txt /backend/
EXPOSE 8000
RUN pip install -r requirements.txt
COPY . /backend/
CMD python manage.py makemigrations
CMD python manage.py migrate
RUN python manage.py migrate
12 changes: 12 additions & 0 deletions backend/Dockerfile.save
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.7.7
ENV PYTHONUNBUFFERED 1

ENV DJANGO_SECRET_KEY="4bih3]<ae<'J_quAQyT2q^2-4'csa
RUN mkdir /backend
WORKDIR /backend
COPY requirements.txt /backend/
EXPOSE 8000
RUN pip install -r requirements.txt
COPY . /backend/
CMD python manage.py makemigrations
CMD python manage.py migrate
8 changes: 4 additions & 4 deletions backend/PeerSupport/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "yP[qaJ4#=ux+k3j[(kJBE%|YxQP*P3"
SECRET_KEY = os.environ['SECRET_KEY']

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['35.238.235.146', 'mutualhelptech.com', 'api']
ALLOWED_HOSTS = os.environ['ALLOWED_HOSTS'].split(" ")

# Email backend settings for Django
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'cwgkixchdkhosgbo'
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_PORT = 587
EMAIL_USE_TLS = True

Expand Down Expand Up @@ -164,7 +164,7 @@
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticatedOrReadOnly',
'rest_framework.permissions.IsAuthenticated',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
Expand Down
2 changes: 1 addition & 1 deletion backend/chat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ChatViewSet(viewsets.ViewSet):

def get_permissions(self):
if self.action == 'list':
self.permission_classes = [IsAdminUser, ]
self.permission_classes = [AllowAny, ]
elif self.action == 'retrieve':
self.permission_classes = [AllowAny, ]

Expand Down
1 change: 0 additions & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
gunicorn==20.0.4
numpy==1.18.5
pandas==1.0.4
asgiref==3.2.7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}
Greetings from the MutualHelp Tech Team!
Greetings from the MutualHelpTech Team!

You're receiving this e-mail because you have registered a new user under the username of {{ user_display }}.
To activate this new account please click the following link: {{ activate_url }}
{% endblocktrans %}{% endautoescape %}
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}
Thank you,

MutualHelp Tech Team
MutualHelpTech Team
{% endblocktrans %}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
backend:
build:
context: ./backend
command: gunicorn PeerSupport.wsgi --bind 0.0.0.0:8000
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"
depends_on:
Expand All @@ -30,4 +30,4 @@ services:
- backend
- frontend
volumes:
build_folder:
build_folder:
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM node:14.4.0-alpine3.10
USER root
WORKDIR /frontend
COPY . /frontend
ENV REACT_APP_HOST_IP_ADDRESS http://35.238.235.146
ENV REACT_APP_HOST_IP_ADDRESS http://127.0.0.1
RUN yarn
RUN yarn build
Loading

0 comments on commit f243201

Please sign in to comment.