Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
8b1365db
Commit
8b1365db
authored
Nov 05, 2016
by
mdsecurity
Browse files
added working docker-compose and Docker file
parent
34c1a2d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Dockerfile
0 → 100644
View file @
8b1365db
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
docker-compose.yml
0 → 100644
View file @
8b1365db
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
go/settings/secret.py.template
→
secret.py
View file @
8b1365db
...
...
@@ -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
=
""
...
...
go/settings/
settings.py
.template
→
settings.py
View file @
8b1365db
...
...
@@ -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 =
Fals
e
DEBUG
=
Tru
e
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
"
startup.sh
0 → 100755
View file @
8b1365db
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment