Skip to content

Commit 27ad0e8

Browse files
committed
dockerfile update
1 parent 033e4c5 commit 27ad0e8

File tree

6 files changed

+29
-62
lines changed

6 files changed

+29
-62
lines changed

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
FROM python:3
1+
FROM amazon/aws-eb-python:3.4.2-onbuild-3.5.1
2+
3+
# Expose port
4+
EXPOSE 8080
25
ENV PYTHONUNBUFFERED 1
36
RUN python -m pip install --upgrade pip
4-
RUN mkdir /code
5-
WORKDIR /code
7+
RUN mkdir /var/app
8+
WORKDIR /var/app
69
COPY requirements.txt /code/
710
RUN pip install -r requirements.txt
8-
COPY . /code/
9-
11+
COPY . /var/app/.
12+
EXPOSE 8000

Dockerrun.aws.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"AWSEBDockerrunVersion": "5",
3+
"Volumes": [
4+
{
5+
"ContainerDirectory": "/var/app",
6+
"HostDirectory": "/var/app",
7+
"ContainerPort": "8080"
8+
}
9+
],
10+
"Logging": "/var/app/eb_log"
11+
}

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker-compose.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ services:
44
db:
55
image: postgres
66
environment:
7-
- POSTGRES_DB=postgres
8-
- POSTGRES_USER=postgres
9-
- POSTGRES_PASSWORD=postgres
7+
- DJANGO_SETTINGS_MODULE=settings.production
8+
- RDS_DB_NAME=postgres
9+
- RDS_USERNAME=postgres
10+
- RDS_PASSWORD='postgres'
11+
- RDS_HOSTNAME=db
12+
- RDS_PORT=5432
1013
web:
1114
build: .
1215
command: gunicorn screencast.wsgi:application --bind 0.0.0.0:8000
16+
volumes:
17+
- .:/var/app
1318
ports:
1419
- "8000:8000"
1520
depends_on:

requirements.txt

14 Bytes
Binary file not shown.

screencast/settings.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import os
1414
from datetime import timedelta
15-
import django_heroku
1615
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1716
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1817

@@ -43,9 +42,6 @@
4342
'api',
4443
'rest_framework',
4544
'corsheaders',
46-
'rest_framework_social_oauth2',
47-
'oauth2_provider',
48-
'social_django',
4945
]
5046

5147
MIDDLEWARE = [
@@ -95,16 +91,6 @@
9591
WSGI_APPLICATION = 'screencast.wsgi.application'
9692
CORS_ORIGIN_ALLOW_ALL = True
9793

98-
99-
# Database
100-
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
101-
102-
#DATABASES = {
103-
#'default': {
104-
# 'ENGINE': 'django.db.backends.sqlite3',
105-
#'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
106-
# }
107-
#}
10894
if 'RDS_DB_NAME' in os.environ:
10995
DATABASES = {
11096
'default': {
@@ -123,7 +109,7 @@
123109
'NAME': 'postgres',
124110
'USER': 'postgres',
125111
'PASSWORD': 'postgres',
126-
'HOST': 'postgres',
112+
'HOST': 'db',
127113
'PORT': '5432',
128114
}
129115
}
@@ -182,41 +168,6 @@
182168
MEDIA_URL='/media/'
183169
MEDIA_ROOT=os.path.join(BASE_DIR,' media')
184170

185-
# Facebook configuration
186-
SOCIAL_AUTH_FACEBOOK_KEY = ''
187-
SOCIAL_AUTH_FACEBOOK_SECRET = ''
188-
#SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
189-
# Google configuration
190-
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '417817522855-24jn957g7r6a5nqnlomfq47esqt0ns9v.apps.googleusercontent.com'
191-
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'nZUZevgPjTYFzWJT4_Qj9yKd'
192-
193-
# Define SOCIAL_AUTH_FACEBOOK_SCOPE to get extra permissions from facebook. Email is not sent by default, to get it, you must request the email permission:
194-
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
195-
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
196-
'fields': 'id, name, email' }
197-
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
198-
FACEBOOK_EXTENDED_PERMISSIONS = ['email']
199-
200-
# Define SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE to get extra permissions from Google.
201-
SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = [
202-
'https://www.googleapis.com/auth/userinfo.email',
203-
'https://www.googleapis.com/auth/userinfo.profile',
204-
]
205-
SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['username', 'first_name', 'email']
206-
SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
207-
208-
SOCIAL_AUTH_PIPELINE = (
209-
'social_core.pipeline.social_auth.social_details',
210-
'social_core.pipeline.social_auth.social_uid',
211-
'social_core.pipeline.social_auth.auth_allowed',
212-
'social_core.pipeline.social_auth.social_user',
213-
'social_core.pipeline.user.get_username',
214-
'social_core.pipeline.social_auth.associate_by_email',
215-
'social_core.pipeline.user.create_user',
216-
'social_core.pipeline.social_auth.associate_user',
217-
'social_core.pipeline.social_auth.load_extra_data',
218-
'social_core.pipeline.user.user_details', )
219-
220171
SIMPLE_JWT = {
221172
'ACCESS_TOKEN_LIFETIME': timedelta( days=3),
222173
'REFRESH_TOKEN_LIFETIME': timedelta(days=2),
@@ -235,6 +186,4 @@
235186
'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp',
236187
'SLIDING_TOKEN_LIFETIME': timedelta(minutes=30),
237188
'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1),
238-
}
239-
240-
django_heroku.settings(locals())
189+
}

0 commit comments

Comments
 (0)