Skip to content

Commit 78171dc

Browse files
committed
Write new Dockerfile, using apt and prebuilt binaries where possible
1 parent ba8bd76 commit 78171dc

File tree

3 files changed

+51
-66
lines changed

3 files changed

+51
-66
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*
2+
!config-template

Dockerfile

+36-32
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
FROM ubuntu/apache2:2.4-20.04_beta
22

3-
RUN ln -sf /dev/stdout /var/log/apache2/access.log && ln -sf /dev/stderr /var/log/apache2/error.log && a2enmod cgi
4-
RUN apt update -y && apt install -y mongodb ca-certificates curl python python3-pip && rm -rf /var/lib/apt/lists/* && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python
5-
RUN pip install --no-cache-dir numpy==1.11.2 pymongo==3.8.0 requests==2.22.0 && pip3 install --no-cache-dir numpy==1.17.2 pymongo==3.8.0 requests==2.20.0 Jinja2==2.10.1 GitPython==3.0.5
3+
# Match Docker expectations for logging like the Docker Library nginx image
4+
RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
5+
ln -sf /dev/stderr /var/log/apache2/error.log && \
6+
# Enable Common Gateway Interface scripts that comprise much of FORCAST's backend
7+
a2enmod cgi
8+
RUN apt update -y && \
9+
apt install -y \
10+
# MongoDB 3.6 for storing guides and primers
11+
mongodb \
12+
# General downloads here, unzip JBrowse
13+
ca-certificates curl unzip \
14+
# Convenient downloads for Dicey from GEAR Genomics Tracy
15+
wget rename \
16+
# FORCAST uses both Python 2 and 3 for some reason
17+
python python3-pip \
18+
# Bioinformatics tools used when installing new genomes
19+
bwa bedtools samtools ncbi-blast+ && \
20+
# FORCAST primer design feature after setup
21+
primer3 && \
22+
# Remove lists pulled by apt update for consistent images
23+
rm -rf /var/lib/apt/lists/* && \
24+
# python-pip is no longer included in the distribution as Python 2 is out of support
25+
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python
26+
RUN mkdir -p /opt/dicey/bin && \
27+
mkdir -p /opt/dicey/dicey_tempfiles && \
28+
curl -Lo /opt/dicey/bin/dicey https://github.com/gear-genomics/dicey/releases/download/v0.1.8/dicey_v0.1.8_linux_x86_64bit && \
29+
chmod +x /opt/dicey/bin/dicey
30+
ARG JBROWSE_VERSION=1.12.3
31+
RUN curl -LO https://jbrowse.org/releases/JBrowse-${JBROWSE_VERSION}/JBrowse-${JBROWSE_VERSION}.zip && \
32+
unzip JBrowse-${JBROWSE_VERSION}.zip && \
33+
mv JBrowse-${JBROWSE_VERSION} /var/www/html/jbrowse && \
34+
rm JBrowse-${JBROWSE_VERSION}.zip && \
35+
cd /var/www/html/jbrowse && ./setup.sh
36+
RUN pip install --no-cache-dir numpy==1.11.2 pymongo==3.8.0 requests==2.22.0 && \
37+
pip3 install --no-cache-dir numpy==1.17.2 pymongo==3.8.0 requests==2.20.0 Jinja2==2.10.1 GitPython==3.0.5
38+
COPY config-template /var/www/html/config
639

740
CMD service mongodb start && exec apache2-foreground
8-
# Install JBrowse
9-
# Install GuideFinder dependencies?
10-
# Install Primer3, NCBI Blast, Dicey
11-
12-
13-
14-
#FROM ubuntu:16.04
15-
#LABEL maintainer="[email protected]"
16-
#ENV DEBIAN_FRONTEND noninteractive
17-
18-
# INSTALL BASE REQUIREMENTS
19-
#RUN apt-get update && \
20-
# apt-get install -y git sudo apache2 && \
21-
# cd /var/www/html && \
22-
# rm index.html
23-
24-
# CHANGE DOCUMENT ROOT AND SERVERNAME
25-
#WORKDIR /etc/apache2
26-
#RUN sed -i -e "/DocumentRoot/a \ \t\<Directory \'\/var\/www\/html\'\>\n\t\tOptions +ExecCGI\n\t\tAddHandler cgi-script .py\n\t\tAllow from all\n\t</Directory\>" sites-available/000-default.conf
27-
#RUN sed -i '1 i\ServerName FORCAST' apache2.conf
28-
29-
# GET HOST CODE
30-
#COPY . /var/www/html/
31-
#WORKDIR /var/www/html/
32-
33-
# INSTALL DEPENDENCIES
34-
#RUN cd src/installation && \
35-
# ./install.sh /var/www/html && \
36-
# ./setPermissions.sh

docker-compose.yaml

+14-34
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,27 @@
11
version: "3.9"
22
services:
3-
# mongo:
4-
# image: mongo:3.6
5-
# ports:
6-
# - 127.0.0.1:27017:27017
73
forcast:
84
build: .
95
image: ghcr.io/ccmbioinfo/forcast
106
ports:
117
- 80:80
128
volumes:
139
- ./sites-enabled:/etc/apache2/sites-enabled
14-
- ./:/var/www/html
10+
- ./bin:/var/www/html/bin
11+
- ./docs:/var/www/html/docs
12+
- ./src:/var/www/html/src
13+
- ./jbrowse/plugins/ColorByCDS:/var/www/html/jbrowse/plugins/ColorByCDS
14+
- ./jbrowse/plugins/ExportSequence:/var/www/html/jbrowse/plugins/ExportSequence
15+
- ./crispr-icon.png:/var/www/html/crispr-icon.png
16+
- ./index.html:/var/www/html/index.html
1517
- mongodb:/var/lib/mongodb
1618
volumes:
1719
mongodb:
1820

19-
20-
21-
# Install genome and enable dicey
22-
23-
24-
25-
#version: '2'
26-
27-
#services:
28-
# webserver:
29-
# image: helrick/forcast
30-
# expose:
31-
# - ${APACHE2_PORT}
32-
# ports:
33-
# - ${APACHE2_PORT}:${APACHE2_PORT}
34-
# volumes:
35-
# - ./mongodb:/data/db
36-
# - ./src:/var/www/html/src
37-
# - ./jbrowse:/var/www/html/jbrowse
38-
# command: >
39-
# bash -c "sudo mongod --fork --logpath /var/log/mongodb.log
40-
# && cd /var/www/html/jbrowse
41-
# && ./setup.sh
42-
# && python3 /var/www/html/src/setup/setup.py -r /var/www/html -g ${ORGANISM} -v ${ASSEMBLY} -fa2bit /var/www/html/bin/faToTwoBit -b /var/www/html/bin/ncbi-blast-2.7.1+/bin
43-
# && /var/www/html/src/setup/enable_dicey.sh ${ORGANISM} ${ASSEMBLY}
44-
# && cd /var/www/html/src/installation
45-
# && sudo ./setPermissions.sh
46-
# && sudo service apache2 start
47-
# && tail -f /dev/null"
21+
# After startup, exec into the container and run
22+
# cd /var/www/html/src/setup
23+
# python3 setup.py -r /var/www/html -g Saccharomyces_cerevisiae -v R64-1-1 -fa2bit /var/www/html/bin/faToTwoBit -b /usr/bin
24+
# mkdir -p /opt/dicey/indexes/R64-1-1
25+
# cd /opt/dicey/indexes/R64-1-1
26+
# wget -r -np -nH --cut-dirs 2 -A "Saccharomyces_cerevisiae.*" https://gear.embl.de/data/tracy/
27+
# rename "s/^.*.fa\./R64-1-1.fa./" *

0 commit comments

Comments
 (0)