forked from ga4gh/ga4gh-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
27,088 additions
and
2,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Dockerfile | ||
.git | ||
.dockerignore | ||
./build | ||
*.swp | ||
ga4gh-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,61 @@ | ||
############################################################ | ||
## Dockerfile to build the ga4gh server on mod_wsgi-express | ||
## Configurable to use a local dataset | ||
## Based on mod_wsgi-docker | ||
## Results of this build are available from Dockerhub as afirth/ga4gh_server_apache:prod | ||
############################################################ | ||
FROM grahamdumpleton/mod-wsgi-docker:python-2.7-onbuild | ||
FROM ubuntu | ||
|
||
# File Author / Maintainer | ||
MAINTAINER Alastair Firth | ||
# Originally created by Steve Hershman GitHub @hershman | ||
# previously maintained by Alastair Firth | ||
# currently maintained by Maciek Smuga-Otto at UCSC Genomics Institute | ||
MAINTAINER Maciek Smuga-Otto <[email protected]> | ||
|
||
# Place the config, if an existing config is not in place | ||
ADD deploy/config.py /app/ga4gh/docker_config.py | ||
RUN cp --no-clobber /app/ga4gh/docker_config.py /app/ga4gh/config.py | ||
# Update the sources list | ||
RUN apt-get update | ||
|
||
# Pass '-e GA4GH_DATA_SOURCE=/container/data/path' and '-v /host/data/path:/container/data/path:ro' to docker run to mount local data | ||
# See docs for more info | ||
# Install packages | ||
RUN apt-get install -y tar git curl wget dialog net-tools build-essential \ | ||
python python-dev python-distribute python-pip zlib1g-dev \ | ||
apache2 libapache2-mod-wsgi libxslt1-dev libffi-dev libssl-dev | ||
|
||
CMD [ "--working-directory", "ga4gh", \ | ||
"--log-to-terminal", \ | ||
"ga4gh/application.wsgi" ] | ||
# Enable wsgi module | ||
RUN a2enmod wsgi | ||
|
||
# Create cache directories | ||
RUN mkdir /var/cache/apache2/python-egg-cache && \ | ||
chown www-data:www-data /var/cache/apache2/python-egg-cache/ | ||
|
||
# build the GA4GH server | ||
RUN mkdir -p /srv/ga4gh/server | ||
WORKDIR /srv/ga4gh/server | ||
|
||
# Configure the python requirements | ||
# Do this as a separate step prior to the build so that changes | ||
# to the GA4GH Server codebase do not trigger a full rebuild of the | ||
# pip requirements. | ||
COPY requirements.txt /srv/ga4gh/server/ | ||
RUN pip install -r requirements.txt | ||
|
||
# Install the code | ||
COPY . /srv/ga4gh/server/ | ||
RUN python setup.py install | ||
|
||
# Write new apache config | ||
COPY deploy/001-ga4gh.conf /etc/apache2/sites-available/001-ga4gh.conf | ||
|
||
# Write application.wsgi | ||
COPY deploy/application.wsgi /srv/ga4gh/application.wsgi | ||
COPY deploy/config.py /srv/ga4gh/config.py | ||
|
||
# Configure apache to serve GA4GH site | ||
WORKDIR /etc/apache2/sites-enabled | ||
RUN rm -f 000-default.conf && ln -s /etc/apache2/sites-available/001-ga4gh.conf 001-ga4gh.conf | ||
|
||
# Open port 80 for HTTP | ||
EXPOSE 80 | ||
|
||
# Prepare container for deployment | ||
# The directory that the user will land in when executing an interactive shell | ||
WORKDIR /srv/ga4gh/server | ||
|
||
# Default action: Bring up a webserver instance to run as a daemon | ||
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<VirtualHost *:80> | ||
ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | ||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
WSGIDaemonProcess ga4gh python-eggs=/var/cache/apache2/python-egg-cache \ | ||
processes=10 threads=1 | ||
WSGIScriptAlias /ga4gh /srv/ga4gh/application.wsgi | ||
<Directory /srv/ga4gh> | ||
WSGIProcessGroup ga4gh | ||
WSGIApplicationGroup %{GLOBAL} | ||
Require all granted | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
# Configuration file for server, including Flask, see configuration documentation | ||
# for details | ||
# This file needs to be copied to /app/ga4gh/config.py by default | ||
import os | ||
|
||
#TODO this logic could move to frontend.configure() or BaseConfig | ||
# For docker, if/when a default is set in serverconfig.py, run -v /localdata:/default-path | ||
# If the env variable GA4GH_DATA_SOURCE is set, use that path. Otherwise, use the default path | ||
DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/ga4gh-example-data") | ||
|
||
# If the env variable GA4GH_DEBUG is set, use that. Otherwise, use the empty string (False) | ||
# Enable with True. | ||
# WARNING: this enables Flask debugging and is insecure. | ||
DATA_SOURCE = os.getenv('GA4GH_DATA_SOURCE', "/data/repo.db") | ||
DEBUG = os.getenv('GA4GH_DEBUG', "") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.