Skip to content
Snippets Groups Projects
Commit 01d37e1c authored by Thomas Downes's avatar Thomas Downes Committed by GraceDB
Browse files

Update Dockerfile to match thomas.downes branch

parent 7119da4d
No related branches found
No related tags found
No related merge requests found
...@@ -3,45 +3,75 @@ LABEL name="LIGO GraceDB Django application" \ ...@@ -3,45 +3,75 @@ LABEL name="LIGO GraceDB Django application" \
maintainer="tanner.prestegard@ligo.org" \ maintainer="tanner.prestegard@ligo.org" \
date="20181206" date="20181206"
ARG SETTINGS_MODULE="config.settings.container.dev" ARG SETTINGS_MODULE="config.settings.container.dev"
WORKDIR /app
ADD . /app/gracedb_project
# Volumes COPY docker/SWITCHaai-swdistrib.gpg /etc/apt/trusted.gpg.d
VOLUME /app/logs /app/project_data RUN echo 'deb http://pkg.switch.ch/switchaai/debian stretch main' > /etc/apt/sources.list.d/shibboleth.list
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update # the previous command executes apt-get update; if it is removed
RUN apt-get install --assume-yes gcc \ # one must add RUN apt-get update
RUN apt-get install --install-recommends --assume-yes \
apache2 \
gcc \
git \ git \
libapache2-mod-xsendfile \
libmariadbclient-dev \ libmariadbclient-dev \
libldap2-dev \ libldap2-dev \
libsasl2-dev \ libsasl2-dev \
libxml2-dev \ libxml2-dev \
libsqlite3-dev \ libsqlite3-dev \
mariadb-client \ mariadb-client \
nodejs \
python2.7 \ python2.7 \
python2.7-dev \
python-glue \ python-glue \
python-matplotlib \
python-pip \ python-pip \
python-voeventlib python-voeventlib \
procps \
shibboleth \
supervisor \
vim && \
apt-get clean && \
npm install -g bower
# Install npm and bower COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - COPY docker/supervisord-apache2.conf /etc/supervisor/conf.d/apache2.conf
RUN apt-get update && \ COPY docker/shibboleth-ds /etc/shibboleth-ds
apt-get install nodejs && \ COPY docker/apache-config /etc/apache2/sites-available/gracedb.conf
apt-get clean && \ COPY docker/login.ligo.org.cert.LIGOCA.pem /etc/shibboleth/login.ligo.org.cert.LIGOCA.pem
npm install -g bower COPY docker/inc-md-cert.pem /etc/shibboleth/inc-md-cert.pem
RUN a2dissite 000-default.conf && \
a2ensite gracedb.conf && \
a2enmod headers proxy proxy_http rewrite xsendfile
# Set up bower components # this line is unfortunate because "." updates for nearly any change to the
# repository and therefore docker build rarely caches the steps below
ADD . /app/gracedb_project
# install gracedb application itself
WORKDIR /app/gracedb_project WORKDIR /app/gracedb_project
RUN bower install --allow-root RUN bower install --allow-root
RUN pip install --upgrade setuptools wheel && \
# Install Python packages pip install -r requirements.txt
RUN pip install -r requirements.txt
# Give pip-installed packages priority over distribution packages # Give pip-installed packages priority over distribution packages
ENV PYTHONPATH /usr/local/lib/python2.7/dist-packages:$PYTHONPATH ENV PYTHONPATH /usr/local/lib/python2.7/dist-packages:$PYTHONPATH
ENV VIRTUAL_ENV dummy
# Collect static components. Have to set a settings module envvar # Expose port and run Gunicorn
# and fake a few other required environment variables EXPOSE 8000
# Volumes
VOLUME /app/logs /app/project_data
# Generate documentation
WORKDIR /app/gracedb_project/docs/user_docs
RUN sphinx-build -b html source build
WORKDIR /app/gracedb_project/docs/admin_docs
RUN sphinx-build -b html source build
WORKDIR /app/gracedb_project
RUN DJANGO_SETTINGS_MODULE=${SETTINGS_MODULE} \ RUN DJANGO_SETTINGS_MODULE=${SETTINGS_MODULE} \
DJANGO_DB_NAME=fake_name \ DJANGO_DB_NAME=fake_name \
DJANGO_DB_PASSWORD=fake_password \ DJANGO_DB_PASSWORD=fake_password \
...@@ -49,6 +79,4 @@ RUN DJANGO_SETTINGS_MODULE=${SETTINGS_MODULE} \ ...@@ -49,6 +79,4 @@ RUN DJANGO_SETTINGS_MODULE=${SETTINGS_MODULE} \
DJANGO_PRIMARY_FQDN=fake_fqdn \ DJANGO_PRIMARY_FQDN=fake_fqdn \
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
# Expose port and run Gunicorn CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
EXPOSE 8000
CMD ["gunicorn", "--reload", "--bind", "0.0.0.0:8000", "config.wsgi:application"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment