Skip to content

Commit

Permalink
Refactor Docker image to use Python 3 via micromamba
Browse files Browse the repository at this point in the history
This commit also includes some cleanup and refactoring of the Dockerfiles. This
also merges the previously separate Dockerfiles.

Currently this assumes that the Python 3 version of the CRISPResso2 source code
is found in the root directory of the project under the name `CRISPResso2`.
  • Loading branch information
Colelyman committed Jun 10, 2021
1 parent 926f84e commit cd3746b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 73 deletions.
51 changes: 0 additions & 51 deletions C2/Dockerfile

This file was deleted.

94 changes: 72 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,100 @@

# Set the base image to anaconda python 2.7
#FROM kclem/c2wbase:1.1
FROM c2wbase:1.2
FROM mambaorg/micromamba:0.13.1

# File Author / Maintainer
MAINTAINER Kendell Clement

ENV SHELL bash

#install CRISPResso

# Install dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "deb http://http.us.debian.org/debian buster main contrib" >> /etc/apt/sources.list && \
echo "deb http://security.debian.org buster/updates main contrib" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
apache2 \
apache2-dev \
build-essential \
cron \
gcc \
libapache2-mod-wsgi \
rabbitmq-server \
ssl-cert \
ttf-mscorefonts-installer \
tmpreaper \
unzip \
wget \
zip && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

# Install Micromamba
RUN micromamba install -y -n base \
bowtie2 \
celery=4.4.6 \
cython \
email_validator \
flask \
flask-admin \
flask-mail \
flask-wtf \
flask-sqlalchemy \
flask-login \
flash \
numpy \
python=3.8 \
pip \
samtools \
sqlalchemy=1.3.23 \
trimmomatic \
werkzeug \
vine \
-c bioconda \
-c conda-forge && \
micromamba clean --all --yes && \
pip install mod_wsgi && \
mod_wsgi-express module-config > /etc/apache2/mods-available/wsgi.load

# Install CRISPResso
ARG crispresso_version='2.1.0'
WORKDIR /tmp/CRISPResso2
RUN wget https://github.com/pinellolab/CRISPResso2/archive/v${crispresso_version}.zip \
&& unzip v${crispresso_version}.zip \
&& cd /tmp/CRISPResso2/CRISPResso2-${crispresso_version} \
&& python setup.py install \
&& CRISPResso -h \
&& rm -rf /tmp/CRISPResso2
# RUN wget https://github.com/pinellolab/CRISPResso2/archive/v${crispresso_version}.zip \
# && unzip v${crispresso_version}.zip \
COPY ./CRISPResso2 /tmp/CRISPResso2
RUN cd /tmp/CRISPResso2/ && \
python setup.py install && \
CRISPResso -h && \
rm -rf /tmp/CRISPResso2

#install flower
#RUN conda install flower \
# && conda clean -ay
#RUN micromamba install flower \
# && micromamba clean -ay

ENV C_FORCE_ROOT "true"

#install CRISPRessoWEB
WORKDIR /var/www/webapps/CRISPRessoWEB
RUN mkdir -p /var/www/CRISPResso_TMP/UPLOADS \
&& mkdir -p /var/www/CRISPResso_TMP/REPORTS \
&& mkdir -p /var/www/CRISPResso_TMP/DATA \
&& mkdir -p /var/www/CRISPResso_TMP/SERVER \
&& chmod -R 777 /var/www/CRISPResso_TMP
RUN mkdir -p /var/www/CRISPResso_TMP/UPLOADS && \
mkdir -p /var/www/CRISPResso_TMP/REPORTS && \
mkdir -p /var/www/CRISPResso_TMP/DATA && \
mkdir -p /var/www/CRISPResso_TMP/SERVER && \
chmod -R 777 /var/www/CRISPResso_TMP
COPY . /var/www/webapps/CRISPRessoWEB
#RUN crontab add_to_crontab
RUN cp conf_files/apache/httpd-vhosts.conf /etc/apache2/sites-available/crispresso.conf \
&& cp conf_files/celery_daemon/celeryd /etc/init.d/ && chmod +x /etc/init.d/celeryd \
&& chmod -R 755 /var/www/webapps/CRISPRessoWEB
RUN a2ensite crispresso \
&& a2dissite 000-default
RUN cp conf_files/apache/httpd-vhosts.conf /etc/apache2/sites-available/crispresso.conf && \
cp conf_files/celery_daemon/celeryd /etc/init.d/ && chmod +x /etc/init.d/celeryd && \
chmod -R 755 /var/www/webapps/CRISPRessoWEB
RUN a2ensite crispresso && \
a2dissite 000-default

#recreate demo files
# WORKDIR /var/www/webapps/CRISPRessoWEB/CRISPRessoWEB/static/demo
# RUN run.sh



EXPOSE 80

#flower port (activate flower in start_server_docker.sh)
Expand Down

0 comments on commit cd3746b

Please sign in to comment.