diff --git a/Dockerfile b/Dockerfile index 6f146e572..84d0c0bf5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,16 @@ # WebApollo # VERSION 2.0 -FROM tomcat:8-jre8 +FROM quay.io/gmod/docker-apollo:unified MAINTAINER Eric Rasche , Anthony Bretaudeau , Nathan Dunn -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get -qq update --fix-missing && \ - apt-get --no-install-recommends -y install \ - git build-essential maven tomcat8 libpq-dev postgresql-common openjdk-8-jdk wget \ - postgresql postgresql-client xmlstarlet netcat libpng12-dev \ - zlib1g-dev libexpat1-dev ant curl ssl-cert - -RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - -RUN apt-get -qq update --fix-missing && \ - apt-get --no-install-recommends -y install nodejs && \ - apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN npm install -g bower && \ - cp /usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/tools.jar && \ - useradd -ms /bin/bash -d /apollo apollo - -ENV WEBAPOLLO_VERSION 7b304aac81f7dab77165f37bf210a6b3cb1b8080 -RUN curl -L https://github.com/GMOD/Apollo/archive/${WEBAPOLLO_VERSION}.tar.gz | tar xzf - --strip-components=1 -C /apollo - - -COPY build.sh /bin/build.sh -ADD apollo-config.groovy /apollo/apollo-config.groovy - -RUN chown -R apollo:apollo /apollo -USER apollo -RUN bash /bin/build.sh -USER root - -ENV CATALINA_HOME=/usr/local/tomcat/ -RUN rm -rf ${CATALINA_HOME}/webapps/* && \ - cp /apollo/apollo*.war ${CATALINA_HOME}/apollo.war - -ENV CONTEXT_PATH ROOT - -# Download chado schema -RUN wget --quiet https://github.com/erasche/chado-schema-builder/releases/download/1.31-jenkins97/chado-1.31.sql.gz -O /chado.sql.gz && \ - gunzip /chado.sql.gz -ADD user.sql /apollo/user.sql - -ADD launch.sh /launch.sh -CMD "/launch.sh" - +RUN apk update && \ + apk add bash perl make gcc perl-dev musl-dev db-dev && \ + cd / && \ + wget http://jbrowse.org/wordpress/wp-content/plugins/download-monitor/download.php?id=109 -O JBrowse-1.12.3.zip && \ + unzip JBrowse-1.12.3.zip && \ + rm JBrowse-1.12.3.zip && \ + cd JBrowse-1.12.3 && \ + sed -i 's|bin/cpanm|bin/cpanm --no-wget|g' setup.sh && \ + ./bin/cpanm local::lib --no-wget && \ + bash setup.sh && \ + apk del make gcc perl-dev musl-dev db-dev diff --git a/README.md b/README.md index b11b8e277..4e3fe8922 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# Apollo -![Apollo Logo](https://github.com/GMOD/docker-apollo/raw/master/img/ApolloLogo_100x36.png) -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.268535.svg)](https://doi.org/10.5281/zenodo.268535) +# ![Apollo](img/ApolloLogo_100x36.png) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.268535.svg)](https://doi.org/10.5281/zenodo.268535) [![Docker Repository on Quay](https://quay.io/repository/gmod/docker-apollo/status "Docker Repository on Quay")](https://quay.io/repository/gmod/docker-apollo) > Apollo is a browser-based tool for visualisation and editing of sequence > annotations. It is designed for distributed community annotation efforts, @@ -10,31 +8,32 @@ > different locations; real-time updating keeps all users in sync during the > editing process. -## Running the Container +## Quickstart -The container is publicly available as `gmod/apollo:stable`. The recommended -method for launching the container is via docker-compose due to a dependency on -a postgres image. +If you've never used docker before, first you will need to [install it](https://docs.docker.com/engine/installation/). -There are a large number of environment variables that can be adjusted to suit -your site's needs. These can be seen in the -[apollo-config.groovy](https://github.com/GMOD/Apollo/blob/master/sample-docker-apollo-config.groovy) -file. +There are several flavours of Apollo images, based on your needs: -## Quickstart +Image | Contents | Comments +---------- | ------------------------------ | ------------- +`:latest` | Apollo + Chado + JBrowse Tools | This is the easiest image to get started with. Just run `docker run -it -p 8080:8080 quay.io/gmod/docker-apollo` +`:unified` | Apollo + Chado | Very similar to the `:latest` image, but does not include the JBrowse tools. Use this if you already have a JBrowse instance you wish to annotate +`:bare` | Apollo | The most lightweight image, especially for admins and people wishing to deploy Apollo in production. + +You can launch these images with `docker run` commands: -This procedure starts tomcat in a standard virtualized environment with a PostgreSQL database with [Chado](http://gmod.org/wiki/Introduction_to_Chado). +```console +$ docker run -it -p 8080:8080 quay.io/gmod/docker-apollo:latest +$ docker run -it -p 8080:8080 quay.io/gmod/docker-apollo:unified +``` -- Install [docker](https://docs.docker.com/engine/installation/) for your system if not previously done. -- `docker run -it -p 8888:8080 gmod/apollo:2.0.6` # for a tested release -- `docker run -it -p 8888:8080 gmod/apollo:latest` # for the latest, remember to ```docker pull gmod/apollo``` to fetch newer versions -- `docker run -it -p 8888:8080 gmod/apollo:apollo-only` # from apollo only (no postgresql) -- `docker run -it -v /jbrowse/root/directory/:/data -p 8888:8080 gmod/apollo:latest` -- `docker run -it -v /jbrowse/root/directory/:/data -p 8888:8080 quay.io/gmod/docker-apollo` # built by quay.io -- Apollo will be available at [http://localhost:8888/](http://localhost:8888/) (or 8888 if you don't configure the port) +If you need to load data, you can mount a volume into the docker container: -When you use the above mount directory ```/jbrowse/root/directory``` and your genome is in -```/jbrowse/root/directory/myawesomegenome``` you'll point to the directory: ```/data/myawesomegenome```. +```console +$ docker run -it -v /jbrowse/dir/:/data -p 8080:8080 quay.io/gmod/docker-apollo +``` + +When you access this data within Apollo, you should refer to `/jbrowse/dir/my-organism` as `/data/my-organism` ### Logging In @@ -48,10 +47,8 @@ The default credentials in this image are: ### Loading Data -Some sample data is baked into the container for you to play around with: - -![](./img/sample.png) - -### Chado +Sample data is available within the container thanks to the JBrowse installation in this image. E.g.: -Chado support is now baked into the GMOD docker container image. +- `/JBrowse-1.12.3/sample_data/json/volvox` +- `/JBrowse-1.12.3/sample_data/json/yeast` +- `/JBrowse-1.12.3/sample_data/json/modencode` diff --git a/apollo-config.groovy b/apollo-config.groovy deleted file mode 100644 index 8f6ad758c..000000000 --- a/apollo-config.groovy +++ /dev/null @@ -1,128 +0,0 @@ -environments { - development { - } - test { - } - production { - dataSource { - dbCreate = "update" - username = System.getenv("WEBAPOLLO_DB_USERNAME") ?: "apollo" - password = System.getenv("WEBAPOLLO_DB_PASSWORD") ?: "apollo" - - driverClassName = "org.postgresql.Driver" - dialect = "org.hibernate.dialect.PostgresPlusDialect" - url = System.getenv("WEBAPOLLO_DB_URI") ?: "jdbc:postgresql://127.0.0.1/apollo" - - properties { - // See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation - jmxEnabled = false - initialSize = 5 - maxActive = 50 - minIdle = 5 - maxIdle = 25 - maxWait = 10000 - maxAge = 10 * 60000 - timeBetweenEvictionRunsMillis = 5000 - minEvictableIdleTimeMillis = 60000 - validationQuery = "SELECT 1" - validationQueryTimeout = 3 - validationInterval = 15000 - testOnBorrow = true - testWhileIdle = true - testOnReturn = false - jdbcInterceptors = "ConnectionState" - defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED - } - } - dataSource_chado { - dbCreate = "update" - username = "apollo" - password = "apollo" - - driverClassName = "org.postgresql.Driver" - dialect = "org.hibernate.dialect.PostgresPlusDialect" - url = "jdbc:postgresql://127.0.0.1/chado" - - properties { - // See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation - jmxEnabled = false - initialSize = 5 - maxActive = 50 - minIdle = 5 - maxIdle = 25 - maxWait = 10000 - maxAge = 10 * 60000 - timeBetweenEvictionRunsMillis = 5000 - minEvictableIdleTimeMillis = 60000 - validationQuery = "SELECT 1" - validationQueryTimeout = 3 - validationInterval = 15000 - testOnBorrow = true - testWhileIdle = true - testOnReturn = false - jdbcInterceptors = "ConnectionState" - defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED - } - } - } -} - -apollo { - default_minimum_intron_size = System.getenv("WEBAPOLLO_MINIMUM_INTRON_SIZE") ? System.getenv("WEBAPOLLO_MINIMUM_INTRON_SIZE").toInteger() : 1 - history_size = System.getenv("WEBAPOLLO_HISTORY_SIZE") ? System.getenv("WEBAPOLLO_HISTORY_SIZE").toInteger() : 0 - overlapper_class = System.getenv("WEBAPOLLO_OVERLAPPER_CLASS") ?: "org.bbop.apollo.sequence.OrfOverlapper" - use_cds_for_new_transcripts = System.getenv("WEBAPOLLO_CDS_FOR_NEW_TRANSCRIPTS").equals("true") // will default to false - feature_has_dbxrefs = System.getenv("WEBAPOLLO_FEATURE_HAS_DBXREFS") ?: true - feature_has_attributes = System.getenv("WEBAPOLLO_FEATURE_HAS_ATTRS") ?: true - feature_has_pubmed_ids = System.getenv("WEBAPOLLO_FEATURE_HAS_PUBMED") ?: true - feature_has_go_ids = System.getenv("WEBAPOLLO_FEATURE_HAS_GO") ?: true - feature_has_comments = System.getenv("WEBAPOLLO_FEATURE_HAS_COMMENTS") ?: true - feature_has_status = System.getenv("WEBAPOLLO_FEATURE_HAS_STATUS") ?: true - translation_table = "/config/translation_tables/ncbi_" + (System.getenv("WEBAPOLLO_TRANSLATION_TABLE") ?: "1") + "_translation_table.txt" - get_translation_code = System.getenv("WEBAPOLLO_TRANSLATION_TABLE") ? System.getenv("WEBAPOLLO_TRANSLATION_TABLE").toInteger() : 1 - - // TODO: should come from config or via preferences database - splice_donor_sites = System.getenv("WEBAPOLLO_SPLICE_DONOR_SITES") ? System.getenv("WEBAPOLLO_SPLICE_DONOR_SITES").split(",") : ["GT"] - splice_acceptor_sites = System.getenv("WEBAPOLLO_SPLICE_ACCEPTOR_SITES") ? System.getenv("WEBAPOLLO_SPLICE_ACCEPTOR_SITES").split(",") : ["AG"] - gff3.source = System.getenv("WEBAPOLLO_GFF3_SOURCE") ?: "." - - google_analytics = System.getenv("WEBAPOLLO_GOOGLE_ANALYTICS_ID") ?: ["UA-62921593-1"] - - admin{ - username = System.getenv("APOLLO_ADMIN_EMAIL") ?: "admin@local.host" - password = System.getenv("APOLLO_ADMIN_PASSWORD") ?: "password" - firstName = System.getenv("APOLLO_ADMIN_FIRST_NAME") ?: "Ad" - lastName = System.getenv("APOLLO_ADMIN_LAST_NAME") ?: "min" - } -} - -jbrowse { - git { - url = "https://github.com/GMOD/jbrowse" - tag = "1.12.3-release" - } - plugins { - WebApollo{ - included = true - } - NeatHTMLFeatures{ - included = System.getenv("WEBAPOLLO_JBROWSE_PLUGIN_NEATHTML") ?: true - } - NeatCanvasFeatures{ - included = System.getenv("WEBAPOLLO_JBROWSE_PLUGIN_NEATCANVAS") ?: true - } - RegexSequenceSearch{ - included = true - } - HideTrackLabels{ - included = true - } - // TODO - GCContent{ - git = 'https://github.com/cmdcolin/GCContent' - branch = 'master' - alwaysRecheck = "true" - alwaysPull = "true" - } - } -} diff --git a/build.sh b/build.sh deleted file mode 100644 index 32641800c..000000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -cd /apollo/ && \ - ./apollo clean-all && ./apollo deploy && \ - cp /apollo/target/apollo*.war /tmp/apollo.war && \ - # So we can remove ~1.6 GB of cruft from the image. Ignore errors because cannot remove parent dir /apollo/ - rm -rf /apollo/ || true && \ - # Before moving back into a standardized location (that we have write access to) - mv /tmp/apollo.war /apollo/apollo.war diff --git a/launch.sh b/launch.sh deleted file mode 100755 index 01373721b..000000000 --- a/launch.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -service postgresql start - - - -#!/bin/bash -until pg_isready; do - echo -n "." - sleep 1; -done - -echo "Postgres is up, loading chado" -su postgres -c 'createdb apollo' -su postgres -c 'createdb chado' -su postgres -c 'psql -f /apollo/user.sql' - -su postgres -c 'PGPASSWORD=apollo psql -U apollo -h 127.0.0.1 chado -f /chado.sql' - -# https://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Naming -export CATALINA_HOME=/usr/local/tomcat/ -FIXED_CTX=$(echo "${CONTEXT_PATH}" | sed 's|/|#|g') -WAR_FILE=${CATALINA_HOME}/webapps/${FIXED_CTX}.war - -echo "Starting tomcat with $CATALINA_HOME" -$CATALINA_HOME/bin/shutdown.sh -$CATALINA_HOME/bin/startup.sh - -cp ${CATALINA_HOME}/apollo.war ${WAR_FILE} -tail -f ${CATALINA_HOME}/logs/catalina.out diff --git a/user.sql b/user.sql deleted file mode 100644 index 5015e0579..000000000 --- a/user.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE USER apollo WITH PASSWORD 'apollo'; -GRANT ALL PRIVILEGES ON DATABASE "apollo" to apollo; -GRANT ALL PRIVILEGES ON DATABASE "chado" to apollo;