Skip to content

Commit

Permalink
Feat/logger - add stream handler (#33)
Browse files Browse the repository at this point in the history
* fix(sqlite): create sqlite file on docker start

* feat(logger): add default stdout logger

* fix(setup): disallow zip
  • Loading branch information
philloooo authored Feb 2, 2017
1 parent 68fa469 commit bc4a4bb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ python:
sudo: false

install:
- "pip install . --force --upgrade"
- "python setup.py install --force"

script: "py.test -vv tests"
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:16.04
MAINTAINER CDIS <[email protected]>

RUN apt-get update && apt-get install -y python-pip git python-dev libpq-dev apache2 libapache2-mod-wsgi vim \
RUN apt-get update && apt-get install -y sudo python-pip git python-dev libpq-dev apache2 libapache2-mod-wsgi vim \
&& apt-get clean && apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
ADD . /indexd
RUN cd /indexd && pip install .
RUN cd /indexd && python setup.py install

RUN mkdir -p /var/www/indexd/ && chmod 777 /var/www/indexd && cp /indexd/wsgi.py /var/www/indexd/wsgi.py && cp /indexd/bin/indexd /var/www/indexd/indexd

Expand Down Expand Up @@ -35,6 +35,7 @@ EXPOSE 80

WORKDIR /var/www/indexd


# this allows container to be restarted
RUN rm -f /var/run/apache2/apache2.pid

Expand Down
1 change: 1 addition & 0 deletions dockerrun.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

sed -i.bak -e 's/WSGIDaemonProcess indexd processes=1 threads=3/WSGIDaemonProcess indexd processes='${WSGI_PROCESSES:-1}' threads='${WSGI_THREADS:-3}'/g' /etc/apache2/sites-available/apache-indexd.conf
cd /var/www/indexd; sudo -u www-data python wsgi.py
/usr/sbin/apache2ctl -D FOREGROUND
3 changes: 3 additions & 0 deletions indexd/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from .blueprint import blueprint as cross_blueprint
import os
import sys
from cdispyutils.log import get_handler

def app_init(app, settings=None):
app.logger.addHandler(get_handler())
if not settings:
from default_settings import settings
app.config.update(settings['config'])
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[easy_install]
zip_ok = false
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
'flask==0.10.1',
'jsonschema==2.5.1',
'sqlalchemy==1.0.8',
'psycopg2==2.6.1',
'psycopg2==2.6.1',
'cdispyutils',
],
dependency_links=[
"git+https://github.com/uc-cdis/[email protected]#egg=cdispyutils",
],
)

0 comments on commit bc4a4bb

Please sign in to comment.