Unverified Commit 8065d9ac authored by David Haynes's avatar David Haynes
Browse files

feat: Docker and docker-compose support

- Just run `docker-compose build` and `docker-compose up` and the site will build

Closes #33
parent 110bf730
......@@ -18,49 +18,57 @@
# (You'll need to reverse proxy port 8000 via nginx)
# Set the base image to Ubuntu
FROM ubuntu:16.04
FROM python:2.7
ENV PYTHONUNBUFFERED 1
# File Author / Maintainer
MAINTAINER Student-Run Computing and Technology - GMU
# MAINTAINER Student-Run Computing and Technology - GMU
# Update the sources list
RUN apt-get update
RUN apt-get install netcat -y
RUN mkdir /whats_open
WORKDIR /whats_open
ADD /requirements/ /whats_open/
RUN pip install -r base.txt
ADD . /whats_open/
# Install basic applications
RUN apt-get install -y tar git curl nano wget dialog net-tools build-essential
# RUN apt-get install -y tar git curl nano wget dialog net-tools build-essential
# Install Python and Basic Python Tools
RUN apt-get install -y python python-dev python-distribute python-pip
# # Install Python and Basic Python Tools
# RUN apt-get install -y python python-dev python-distribute python-pip
# Clone down SRCT-Web
RUN git clone https://github.com/srct/whats-open.git whats-open
# # Clone down SRCT-Web
# RUN git clone https://github.com/srct/whats-open.git whats-open
# Get pip to download and install requirements:
RUN pip install -r /whats-open/requirements.txt
# # Get pip to download and install requirements:
# RUN pip install -r /whats-open/requirements.txt
# Set this to a unique, secure value before building
# (http://www.miniwebtool.com/django-secret-key-generator/)
ENV SECRET_KEY ""
# # Set this to a unique, secure value before building
# # (http://www.miniwebtool.com/django-secret-key-generator/)
# ENV SECRET_KEY ""
# Set the default directory where CMD will execute
WORKDIR /whats-open/whats_open
# # Set the default directory where CMD will execute
# WORKDIR /whats-open/whats_open
# Setup database
RUN python manage.py syncdb --noinput
RUN python manage.py migrate website --noinput
# # Setup database
# RUN python manage.py syncdb --noinput
# RUN python manage.py migrate website --noinput
# Generate static files in the STATIC_ROOT location
# (https://docs.djangoproject.com/en/dev/howto/static-files/deployment/)
RUN python manage.py collectstatic --noinput
# # Generate static files in the STATIC_ROOT location
# # (https://docs.djangoproject.com/en/dev/howto/static-files/deployment/)
# RUN python manage.py collectstatic --noinput
# Add any inital data fixtures
# (https://docs.djangoproject.com/en/dev/howto/initial-data/)
ADD fixtures /whats-open/whats_open/
# Import the loaded fixtures
RUN python manage.py loaddata users schedules
# # Add any inital data fixtures
# # (https://docs.djangoproject.com/en/dev/howto/initial-data/)
# ADD fixtures /whats-open/whats_open/
# # Import the loaded fixtures
# RUN python manage.py loaddata users schedules
# Expose ports
EXPOSE 80
# # Expose ports
# EXPOSE 80
# Use Gunicorn to server the application
CMD gunicorn whats_open.wsgi:application -b 0.0.0.0:80
# # Use Gunicorn to server the application
# CMD gunicorn whats_open.wsgi:application -b 0.0.0.0:80
version: '2'
services:
web:
build: .
restart: always
ports:
- '8000:8000'
command: /bin/bash ./startup.sh -python whats_open/manage.py runserver 0.0.0.0:8000
volumes:
- .:/whats_open
environment:
- superuser=admin
- email_domain=@masonlive.gmu.edu
\ No newline at end of file
......@@ -2,3 +2,4 @@ Django>1.10, <1.11
django-autoslug==1.9.3
django-cas-client==1.2.0
djangorestframework==3.6.2
django-model-utils==2.6.1
\ No newline at end of file
python whats_open/manage.py flush --no-input
python whats_open/manage.py makemigrations
python whats_open/manage.py makemigrations website
python whats_open/manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.filter(email='$superuser$email_domain').delete(); User.objects.create_superuser('$superuser$email_domain', '$superuser', 'admin')" | python whats_open/manage.py shell
python whats_open/manage.py runserver 0.0.0.0:8000
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