Commit 8b1365db authored by mdsecurity's avatar mdsecurity

added working docker-compose and Docker file

parent 34c1a2d9
FROM python:2.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /go
WORKDIR /go
ADD requirements.txt /go/
#
RUN apt-get update
RUN apt-get install git-all -y
RUN apt-get install python2.7-dev -y
RUN apt-get install libsasl2-dev -y
RUN apt-get install libldap2-dev -y
RUN apt-get install
RUN pip install -r requirements.txt
ADD . /go/
CMD ./startup.sh
version: '2'
services:
web:
build: .
ports:
- "8000:8000"
command: python go/manage.py runserver 0.0.0.0:8000
volumes:
- .:/go
depends_on:
- db
db:
image: mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: go
MYSQL_USER: go
MYSQL_PASSWORD: go
\ No newline at end of file
......@@ -2,13 +2,13 @@
# Please be sure to keep these variables secret in production
# You can generate a secret key from the following link: http://www.miniwebtool.com/django-secret-key-generator/
SECRET_KEY = ""
SECRET_KEY = "much-secret"
# Use the values from the database configuration
DB_NAME = ""
DB_USER = ""
DB_NAME = "go"
DB_USER = "go"
# Remember to use a strong password in production
DB_PASSWORD = ""
DB_PASSWORD = "go"
# Often left blank
DB_HOST = ""
......
......@@ -8,7 +8,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# DEBUG mode is used to view more details when errors occur
# Do not have set True in production
DEBUG = False
DEBUG = True
ADMINS = ()
MANAGERS = ADMINS
......@@ -16,17 +16,17 @@ MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': secret.DB_NAME,
'USER': secret.DB_USER,
'PASSWORD': secret.DB_PASSWORD,
'HOST': secret.DB_HOST,
'PORT': '',
'NAME': 'go',
'USER': 'go',
'PASSWORD': 'go',
'HOST': 'db',
'PORT': '3306',
}
}
# The domains this application will be deployed on
# e.g. Which domains this app should listen to requests from.
ALLOWED_HOSTS = ['127.0.0.1']
ALLOWED_HOSTS = ['*']
# Peoplefinder API
PF_URL = "http://api.srct.gmu.edu/pf/v1/"
......@@ -162,7 +162,7 @@ if AUTH_MODE.lower() == 'ldap':
AUTH_LDAP_ALWAYS_UPDATE_USER = True
elif AUTH_MODE.lower() == 'cas':
CAS_SERVER_URL = "https://login.gmu.edu"
CAS_SERVER_URL = "https://nanderson.me/cas/"
CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True
......@@ -197,4 +197,4 @@ EMAIL_TO = "to@example.com"
# Domain used to email to users. See line 231 in views.py
# ie. in Mason's case '@masonlive.gmu.edu'
EMAIL_DOMAIN = "@example.com"
EMAIL_DOMAIN = "@masonlive.gmu.edu"
python go/manage.py runserver 0.0.0.0:8000
python go/manage.py flush --no-input
python go/manage.py makemigrations
python go/manage.py makemigrations go
python go/manage.py migrate
python go/manage.py createsuperuser --noinput --username=dhaynes3 --email=dhaynes3@masonlive.gmu.edu
#echo "from django.contrib.auth.models import User; User.objects.create_superuser('dhaynes3', 'admin@example.com', 'pass')" | python manage.py shell
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment