Skip to content

Commit

Permalink
Feat/base peregrine (#110)
Browse files Browse the repository at this point in the history
* feat(base-peregrine): alpine image changes

* feat(base-peregrine): unify uwsgi and nginx confs

* feat(base-peregrine): use generic dockerrun

* feat(base-peregrine): updated uwsgi.ini with timeouts

* feat(base-peregrine): remove extraneous deployment files

* feat(base-peregrine): update cdispyutils pin
  • Loading branch information
stevencui729 authored Mar 20, 2019
1 parent 982750b commit 365d957
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 264 deletions.
47 changes: 7 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,27 @@
# To run: docker run -v /path/to/wsgi.py:/var/www/peregrine/wsgi.py --name=peregrine -p 81:80 peregrine
# To check running container: docker exec -it peregrine /bin/bash
# To check running container: docker exec -it peregrine /bin/bash

FROM ubuntu:16.04
FROM quay.io/cdis/py27base:pybase2-1.0.0

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
# dependency for cryptography
libffi-dev \
# dependency for pyscopg2 - which is dependency for sqlalchemy postgres engine
libpq-dev \
# dependency for cryptography
libssl-dev \
libxml2-dev \
libxslt1-dev \
nginx \
python2.7 \
python-dev \
python-pip \
python-setuptools \
sudo \
vim \
&& python -m pip install --upgrade pip \
&& python -m pip install --upgrade setuptools \
&& python -m pip install --upgrade uwsgi \
&& mkdir /var/www/peregrine \
&& mkdir -p /var/www/.cache/Python-Eggs/ \
&& chown www-data -R /var/www/.cache/Python-Eggs/ \
&& mkdir /run/nginx/ \
&& mkdir -m 075 /var/run/gen3 \
&& chown root:www-data /var/run/gen3
RUN mkdir /var/www/peregrine \
&& chown www-data /var/www/peregrine

COPY . /peregrine
COPY ./deployment/uwsgi/uwsgi.ini /etc/uwsgi/uwsgi.ini
COPY ./deployment/nginx/nginx.conf /etc/nginx/
COPY ./deployment/nginx/uwsgi.conf /etc/nginx/sites-available/
WORKDIR /peregrine

RUN pip install -r requirements.txt \
&& COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" >peregrine/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >>peregrine/version_data.py \
&& cd /peregrine/src/gdcdictionary && DICTCOMMIT=`git rev-parse HEAD` && echo "DICTCOMMIT=\"${DICTCOMMIT}\"" >>/peregrine/peregrine/version_data.py \
&& DICTVERSION=`git describe --always --tags` && echo "DICTVERSION=\"${DICTVERSION}\"" >>/peregrine/peregrine/version_data.py \
&& python setup.py install \
&& rm /etc/nginx/sites-enabled/default \
&& ln -s /etc/nginx/sites-available/uwsgi.conf /etc/nginx/sites-enabled/uwsgi.conf \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& chown www-data /var/www/peregrine
&& python setup.py install

EXPOSE 80

WORKDIR /var/www/peregrine
WORKDIR /var/www/peregrine

ENTRYPOINT [ "/bin/sh", "/peregrine/dockerrun.sh" ]
ENTRYPOINT [ "/bin/sh", "/dockerrun.sh" ]
CMD []
82 changes: 0 additions & 82 deletions deployment/nginx/nginx.conf

This file was deleted.

38 changes: 0 additions & 38 deletions deployment/nginx/uwsgi.conf

This file was deleted.

3 changes: 2 additions & 1 deletion deployment/uwsgi/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ buffer-size = 32768
chmod-socket = 666
master = true
processes = 2
harakiri-verbose = true
harakiki-verbose = 20
harakiri = 45
http-timeout = 45
socket-timeout = 45
worker-reload-mercy = 45
reload-mercy = 45
mule-reload-mercy = 45
disable-logging = true
wsgi-file=/var/www/peregrine/wsgi.py
plugins = python
vacuum = true
Expand Down
101 changes: 0 additions & 101 deletions dockerrun.sh

This file was deleted.

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
defusedxml==0.5.0
scipy==0.18.1
SurvivalPy==1.0.2
simplejson==3.8.1
stopit==1.1.1
Expand Down Expand Up @@ -35,7 +34,7 @@ Flask-SQLAlchemy-Session==1.1
-e git+https://git@github.com/uc-cdis/gdcdatamodel.git@1.3.6#egg=gdcdatamodel
-e git+https://git@github.com/NCI-GDC/psqlgraph.git@5cddf49dd03a25bd4e553161d7ad7b9a6fe0ac0d#egg=psqlgraph
-e git+https://git@github.com/NCI-GDC/cdisutils.git@8a8e599fdab5ade9bd8c586132d974a102e5d72d#egg=cdisutils
cdispyutils==0.2.12
cdispyutils==0.2.13
-e git+https://git@github.com/uc-cdis/storage-client.git@0.1.1#egg=storageclient
-e git+https://git@github.com/uc-cdis/dictionaryutils.git@2.0.4#egg=dictionaryutils
-e git+https://git@github.com/uc-cdis/datamodelutils.git@0.4.0#egg=datamodelutils
Expand Down

0 comments on commit 365d957

Please sign in to comment.