Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use osuosl/python_webapp dockerfile #62

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
FROM centos:7

MAINTAINER OSU Open Source Lab, [email protected]
FROM osuosl/python_webapp

RUN sed -i 's/WSGIPATH/ganeti_webmgr.ganeti_web/g' /etc/supervisor.d/app.conf
COPY . /opt/app/src
RUN yum install -y openssl-devel
RUN pip install .

EXPOSE 8000
ENV DJANGO_SETTINGS_MODULE ganeti_webmgr.ganeti_web.settings
# allows developer to set up a volume mount by keeping config out of source dir
ENV GWM_CONFIG_DIR /opt/ganeti_webmgr_config

RUN yum install -y python-devel python-setuptools postgresql-devel gcc curl libffi-devel openssl-devel

RUN easy_install pip


WORKDIR /opt/ganeti_webmgr
COPY . /opt/ganeti_webmgr
# set up config file
COPY ./ganeti_webmgr/ganeti_web/settings/config.yml.dist /opt/ganeti_webmgr_config/config.yml

# Keys generated specifically for Docker
Expand All @@ -23,8 +16,8 @@ RUN echo "DEBUG: true" >> /opt/ganeti_webmgr_config/config.yml
RUN echo "SECRET_KEY: \"f4iIZ1CTjeLvL3LEhf7m2TnhmIgmeOi1ZuooQ7OOdY\"" >> /opt/ganeti_webmgr_config/config.yml
RUN echo "WEB_MGR_API_KEY: \"Sfi7l83bjlGyYUBF4pIp/2vumfwPA+Lwz2ztu32LQ2k\"" >> /opt/ganeti_webmgr_config/config.yml

RUN pip install .
RUN django-admin.py syncdb --noinput
RUN django-admin.py syncdb --migrate --noinput

RUN django-admin.py collectstatic --noinput --settings "ganeti_webmgr.ganeti_web.settings"
RUN django-admin.py syncdb --noinput --settings "ganeti_webmgr.ganeti_web.settings"

RUN echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'password')" | django-admin.py shell
CMD ["django-admin.py", "runserver", "0.0.0.0:8000"]