Skip to content

Instantly share code, notes, and snippets.

@gertvv
Last active January 2, 2016 14:58
Show Gist options
  • Save gertvv/8319889 to your computer and use it in GitHub Desktop.
Save gertvv/8319889 to your computer and use it in GitHub Desktop.
Run bwallace/abstrackr-web in Docker

Run Abstrackr using Docker

Prerequisites

You need docker.

Build

docker build -t=abstrackr .

Run

ABSTRACKR=$(docker run -d -p 8000 abstrackr)
docker logs $ABSTRACKR
ABSTRACKR_PORT=$(docker port $ABSTRACKR 8000 | awk -F: '{ print $2 }')

firefox http://localhost:$ABSTRACKR_PORT 

docker stop $ABSTRACKR
#!/bin/bash
service mysql start
cd abstrackr-web
paster serve development.ini
#
# abstrackr - Pylons development environment configuration
#
# The %(here)s variable will be replaced with the parent directory of this file
#
[DEFAULT]
debug = false
# Uncomment and replace with the address which should receive any error reports
#email_to = you@yourdomain.com
#smtp_server = 'smtp.gmail.com'
#error_email_from = 'byron.wallace@gmail.com'
mail.on = true
[server:main]
use = egg:Paste#http
#host = 127.0.0.1
host = 0.0.0.0
#use = egg:PasteScript#flup_fcgi_thread
#host = sunfire34.eecs.tufts.edu
#host = 0.0.0.0
port = 8000
#port = 6500
#hung_thread_limit = 500
#socket_timeout = 10000
#threadpool_hung_thread_limit = 10000
#threadpool_kill_thread_limit = 10000
#protocol_version = HTTP/1.1
[app:main]
use = egg:abstrackr
full_stack = true
static_files = true
cache_dir = %(here)s/data
beaker.session.key = abstrackr
beaker.session.secret = somesecret
# If you'd like to fine-tune the individual locations of the cache data dirs
# for the Cache data, or the Session saves, un-comment the desired settings
# here:
#beaker.cache.data_dir = %(here)s/data/cache
#beaker.session.data_dir = %(here)s/data/sessions
# SQLAlchemy database URL
#sqlalchemy.url = sqlite:///%(here)s/development.db
sqlalchemy.url = mysql://abstrackr:@localhost/abstrackr
sqlalchemy.pool_recycle = 1800
# set cookie secret for repoze.what (i.e., for authentication)
cookie_secret = 'secretcookie'
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
# Debug mode will enable the interactive debugging tool, allowing ANYONE to
# execute malicious code after an exception is raised.
set debug = true
# Logging configuration
[loggers]
keys = root, routes, abstrackr, sqlalchemy
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_routes]
level = INFO
handlers =
qualname = routes.middleware
# "level = DEBUG" logs the route matched and routing variables.
[logger_abstrackr]
level = DEBUG
handlers = console
qualname = abstrackr
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] [%(threadName)s] %(message)s
datefmt = %H:%M:%S
FROM stackbrew/ubuntu:13.10
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-pip
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q mysql-server
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q mysql-client
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q libmysqlclient-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q wget
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q git-core
RUN wget "http://effbot.org/media/downloads/elementtree-1.2.7-20070827-preview.zip"
RUN pip install elementtree-1.2.7-20070827-preview.zip
RUN rm elementtree-1.2.7-20070827-preview.zip
## it seems to be missing some deps
RUN pip install paster
RUN pip install numpy
RUN pip install pygooglechart
RUN pip install "biopython==1.57"
RUN wget "http://www.dalkescientific.com/EUtils/EUtils-1.0p1.tar.gz"
RUN pip install EUtils-1.0p1.tar.gz
RUN rm EUtils-1.0p1.tar.gz
RUN pip install pastescript
RUN git clone https://github.com/bwallace/abstrackr-web/
RUN cd abstrackr-web && git checkout -b experimental_plus_plus origin/experimental_plus_plus
RUN service mysql start && mysql --user=root mysql -e "CREATE DATABASE abstrackr CHARACTER SET 'utf8';"
RUN service mysql start && mysql --user=root mysql -e "GRANT ALL PRIVILEGES ON abstrackr.* TO abstrackr@localhost;"
ADD development.ini /abstrackr-web/development.ini
RUN cd abstrackr-web && python setup.py develop
RUN service mysql start && cd abstrackr-web && paster setup-app development.ini
ADD abstrackr.sh /usr/local/bin/abstrackr
RUN chmod +x /usr/local/bin/abstrackr
ENTRYPOINT ["/usr/local/bin/abstrackr"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment