Commit a887e8a7 authored by carlosribas's avatar carlosribas
Browse files

Rename Dockerfile to deploy to the Docker Hub

parent eb5167c7
#------------------------------------------------------------------------------
# We have 2 ways to deploy RNAcentral in production:
# bare-metal managed (no root permissions) CentOS 6 VMs and Kubernetes.
#
# This dockerfile is meant to mimic the environment of
# bare-metal CentOS VMs in order to reate a reproducible
# installation of the RNAcentral website.
#
# All local dependencies are installed manually to mirror the
# bare-metal production setup on EBI VMs, where Docker or yum
# are not available.
# This Dockerfile is meant for containerized deployment with Kubernetes.
#
#-------------------------------------------------------------------------------
FROM centos:6.10
FROM debian:latest
RUN yum install -y \
RUN apt-get update && apt-get install -y \
g++ \
build-essential \
curl \
gcc \
git \
httpd \
httpd-devel \
libaio \
"nc.x86_64" \
openssl \
openssl-devel \
tar \
unzip \
wget \
zlib-devel \
gcc-c++ \
make
RUN mkdir /rnacentral
RUN mkdir /rnacentral/local
RUN mkdir /rnacentral/static
ENV LOC /rnacentral/local
# Install Python
# NOTE: Python-2.7.11 and python-2.7.11 are DIFFERENT folders, the former contains the sources, the later - binaries
RUN \
cd $LOC && \
curl -OL http://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz && \
tar -zxvf Python-2.7.11.tgz && \
cd Python-2.7.11 && \
PREFIX=$LOC/python-2.7.11/ && \
export LD_RUN_PATH=$PREFIX/lib && \
./configure --prefix=$PREFIX --enable-shared && \
make && \
make install && \
cd $LOC && \
rm -Rf Python-2.7.11 && \
rm Python-2.7.11.tgz
# Install virtualenv
RUN \
cd $LOC && \
curl -OL https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.0.tar.gz && \
tar -zxvf virtualenv-15.0.0.tar.gz && \
cd virtualenv-15.0.0 && \
$LOC/python-2.7.11/bin/python setup.py install && \
cd $LOC && \
rm -Rf virtualenv-15.0.0.tar.gz && \
rm -Rf virtualenv-15.0.0
# Create RNAcentral virtual environment
RUN \
cd $LOC && \
mkdir virtualenvs && \
cd virtualenvs && \
$LOC/python-2.7.11/bin/virtualenv RNAcentral --python=$LOC/python-2.7.11/bin/python
# Install Redis (the stable version of Redis requires GCC 4.9 or above, not available for centos 6)
RUN \
cd $LOC && \
curl -OL http://download.redis.io/releases/redis-5.0.9.tar.gz && \
tar -xvzf redis-5.0.9.tar.gz && \
cd redis-5.0.9 && \
make && \
cd $LOC && \
rm redis-5.0.9.tar.gz && \
mv redis-5.0.9 redis
tar \
git \
python2.7 \
libpython2.7-dev \
python-pip \
redis-server \
memcached
# Install libevent (memcached requirement)
RUN \
cd $LOC && \
curl --tlsv1 -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz && \
tar -zxvf libevent-2.0.21-stable.tar.gz && \
cd libevent-2.0.21-stable && \
./configure --prefix=$LOC/libevent && \
make && \
make install && \
cd $LOC && \
rm -Rf libevent-2.0.21-stable && \
rm libevent-2.0.21-stable.tar.gz
ARG RNACENTRAL_HOME=/srv/rnacentral
ENV RNACENTRAL_HOME=$RNACENTRAL_HOME
ENV RNACENTRAL_LOCAL=$RNACENTRAL_HOME/local
# Install memcached (requires libevent)
RUN \
cd $LOC && \
curl -OL http://www.memcached.org/files/memcached-1.4.17.tar.gz && \
tar -zxvf memcached-1.4.17.tar.gz && \
cd memcached-1.4.17 && \
./configure --prefix=$LOC/memcached --with-libevent=$LOC/libevent/ && \
make && \
make install && \
cd $LOC && \
rm -Rf memcached-1.4.17 && \
rm memcached-1.4.17.tar.gz
# Create a user for memcached
RUN adduser -g root xfm_adm
RUN mkdir -p $RNACENTRAL_HOME/local
RUN mkdir $RNACENTRAL_HOME/static
# Install Infernal
RUN \
cd $LOC && \
cd $RNACENTRAL_LOCAL && \
curl -OL http://eddylab.org/infernal/infernal-1.1.1.tar.gz && \
tar -xvzf infernal-1.1.1.tar.gz && \
cd infernal-1.1.1 && \
./configure --prefix=$LOC/infernal-1.1.1 && \
./configure --prefix=$RNACENTRAL_LOCAL/infernal-1.1.1 && \
make && \
make install && \
cd easel && \
make install && \
cd $LOC && \
cd $RNACENTRAL_LOCAL && \
rm infernal-1.1.1.tar.gz
# Install mod_wsgi
RUN \
cd $LOC && \
mkdir httpd && \
mkdir httpd/modules && \
curl --tlsv1 -L -o mod_wsgi-3.4.tar.gz https://github.com/GrahamDumpleton/mod_wsgi/archive/3.4.tar.gz && \
tar -zxvf mod_wsgi-3.4.tar.gz && \
cd mod_wsgi-3.4 && \
export LD_RUN_PATH=$LOC/python-2.7.11/lib && \
export LD_LIBRARY_PATH=$LOC/python-2.7.11/lib/:$LD_LIBRARY_PATH && \
./configure --with-python=$LOC/python-2.7.11/bin/python && \
make && \
mv .libs/mod_wsgi.so $LOC/httpd/modules && \
cd $LOC && \
rm -Rf mod_wsgi-3.4 && \
rm mod_wsgi-3.4.tar.gz
# Install UCSC utilities
# Download RNAcentral
RUN \
cd $LOC && \
mkdir ucsc && \
cd ucsc && \
wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/fetchChromSizes && \
wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedToBigBed && \
chmod o+x fetchChromSizes && \
chmod o+x bedToBigBed
# Define container environment variables
ENV RNACENTRAL_HOME /rnacentral/rnacentral-webcode
ENV RNACENTRAL_LOCAL /rnacentral/local
cd $RNACENTRAL_HOME && \
git clone https://github.com/RNAcentral/rnacentral-webcode.git
# Install Django requirements
ADD rnacentral/requirements.txt $RNACENTRAL_HOME/rnacentral/
RUN \
source $LOC/virtualenvs/RNAcentral/bin/activate && \
pip install -r $RNACENTRAL_HOME/rnacentral/requirements.txt
RUN pip install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements.txt
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
# Install Node.js
RUN curl -sL https://rpm.nodesource.com/setup_6.x | bash -
RUN yum install -y nodejs
# Install node.js dependencies
RUN cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production
# Install NPM dependencies
ADD rnacentral/portal/static/package.json $RNACENTRAL_HOME/rnacentral/portal/static/
RUN cd $RNACENTRAL_HOME/rnacentral/portal/static && npm install --only=production
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
# Expose a container port where the website is served
EXPOSE 8000
# Start up the app
ENTRYPOINT \
source $LOC/virtualenvs/RNAcentral/bin/activate && \
supervisord -c $RNACENTRAL_HOME/supervisor/supervisor.conf && \
python $RNACENTRAL_HOME/rnacentral/manage.py runserver 0.0.0.0:8000
CMD python $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/manage.py runserver 0.0.0.0:8000
#------------------------------------------------------------------------------
# We have 2 ways to deploy RNAcentral in production:
# bare-metal managed (no root permissions) CentOS 6 VMs and Kubernetes.
#
# This dockerfile is meant to mimic the environment of
# bare-metal CentOS VMs in order to reate a reproducible
# installation of the RNAcentral website.
#
# All local dependencies are installed manually to mirror the
# bare-metal production setup on EBI VMs, where Docker or yum
# are not available.
#
#-------------------------------------------------------------------------------
FROM centos:6.10
RUN yum install -y \
curl \
gcc \
git \
httpd \
httpd-devel \
libaio \
"nc.x86_64" \
openssl \
openssl-devel \
tar \
unzip \
wget \
zlib-devel \
gcc-c++ \
make
RUN mkdir /rnacentral
RUN mkdir /rnacentral/local
RUN mkdir /rnacentral/static
ENV LOC /rnacentral/local
# Install Python
# NOTE: Python-2.7.11 and python-2.7.11 are DIFFERENT folders, the former contains the sources, the later - binaries
RUN \
cd $LOC && \
curl -OL http://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz && \
tar -zxvf Python-2.7.11.tgz && \
cd Python-2.7.11 && \
PREFIX=$LOC/python-2.7.11/ && \
export LD_RUN_PATH=$PREFIX/lib && \
./configure --prefix=$PREFIX --enable-shared && \
make && \
make install && \
cd $LOC && \
rm -Rf Python-2.7.11 && \
rm Python-2.7.11.tgz
# Install virtualenv
RUN \
cd $LOC && \
curl -OL https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.0.tar.gz && \
tar -zxvf virtualenv-15.0.0.tar.gz && \
cd virtualenv-15.0.0 && \
$LOC/python-2.7.11/bin/python setup.py install && \
cd $LOC && \
rm -Rf virtualenv-15.0.0.tar.gz && \
rm -Rf virtualenv-15.0.0
# Create RNAcentral virtual environment
RUN \
cd $LOC && \
mkdir virtualenvs && \
cd virtualenvs && \
$LOC/python-2.7.11/bin/virtualenv RNAcentral --python=$LOC/python-2.7.11/bin/python
# Install Redis (the stable version of Redis requires GCC 4.9 or above, not available for centos 6)
RUN \
cd $LOC && \
curl -OL http://download.redis.io/releases/redis-5.0.9.tar.gz && \
tar -xvzf redis-5.0.9.tar.gz && \
cd redis-5.0.9 && \
make && \
cd $LOC && \
rm redis-5.0.9.tar.gz && \
mv redis-5.0.9 redis
# Install libevent (memcached requirement)
RUN \
cd $LOC && \
curl --tlsv1 -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz && \
tar -zxvf libevent-2.0.21-stable.tar.gz && \
cd libevent-2.0.21-stable && \
./configure --prefix=$LOC/libevent && \
make && \
make install && \
cd $LOC && \
rm -Rf libevent-2.0.21-stable && \
rm libevent-2.0.21-stable.tar.gz
# Install memcached (requires libevent)
RUN \
cd $LOC && \
curl -OL http://www.memcached.org/files/memcached-1.4.17.tar.gz && \
tar -zxvf memcached-1.4.17.tar.gz && \
cd memcached-1.4.17 && \
./configure --prefix=$LOC/memcached --with-libevent=$LOC/libevent/ && \
make && \
make install && \
cd $LOC && \
rm -Rf memcached-1.4.17 && \
rm memcached-1.4.17.tar.gz
# Create a user for memcached
RUN adduser -g root xfm_adm
# Install Infernal
RUN \
cd $LOC && \
curl -OL http://eddylab.org/infernal/infernal-1.1.1.tar.gz && \
tar -xvzf infernal-1.1.1.tar.gz && \
cd infernal-1.1.1 && \
./configure --prefix=$LOC/infernal-1.1.1 && \
make && \
make install && \
cd easel && \
make install && \
cd $LOC && \
rm infernal-1.1.1.tar.gz
# Install mod_wsgi
RUN \
cd $LOC && \
mkdir httpd && \
mkdir httpd/modules && \
curl --tlsv1 -L -o mod_wsgi-3.4.tar.gz https://github.com/GrahamDumpleton/mod_wsgi/archive/3.4.tar.gz && \
tar -zxvf mod_wsgi-3.4.tar.gz && \
cd mod_wsgi-3.4 && \
export LD_RUN_PATH=$LOC/python-2.7.11/lib && \
export LD_LIBRARY_PATH=$LOC/python-2.7.11/lib/:$LD_LIBRARY_PATH && \
./configure --with-python=$LOC/python-2.7.11/bin/python && \
make && \
mv .libs/mod_wsgi.so $LOC/httpd/modules && \
cd $LOC && \
rm -Rf mod_wsgi-3.4 && \
rm mod_wsgi-3.4.tar.gz
# Install UCSC utilities
RUN \
cd $LOC && \
mkdir ucsc && \
cd ucsc && \
wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/fetchChromSizes && \
wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedToBigBed && \
chmod o+x fetchChromSizes && \
chmod o+x bedToBigBed
# Define container environment variables
ENV RNACENTRAL_HOME /rnacentral/rnacentral-webcode
ENV RNACENTRAL_LOCAL /rnacentral/local
# Install Django requirements
ADD rnacentral/requirements.txt $RNACENTRAL_HOME/rnacentral/
RUN \
source $LOC/virtualenvs/RNAcentral/bin/activate && \
pip install -r $RNACENTRAL_HOME/rnacentral/requirements.txt
# Install Node.js
RUN curl -sL https://rpm.nodesource.com/setup_6.x | bash -
RUN yum install -y nodejs
# Install NPM dependencies
ADD rnacentral/portal/static/package.json $RNACENTRAL_HOME/rnacentral/portal/static/
RUN cd $RNACENTRAL_HOME/rnacentral/portal/static && npm install --only=production
# Expose a container port where the website is served
EXPOSE 8000
# Start up the app
ENTRYPOINT \
source $LOC/virtualenvs/RNAcentral/bin/activate && \
supervisord -c $RNACENTRAL_HOME/supervisor/supervisor.conf && \
python $RNACENTRAL_HOME/rnacentral/manage.py runserver 0.0.0.0:8000
#------------------------------------------------------------------------------
#
# This Dockerfile is meant for containerized deployment with Kubernetes.
#
#-------------------------------------------------------------------------------
FROM debian:latest
RUN apt-get update && apt-get install -y \
g++ \
build-essential \
curl \
wget \
tar \
git \
python2.7 \
libpython2.7-dev \
python-pip \
redis-server \
memcached
ARG RNACENTRAL_HOME=/srv/rnacentral
ENV RNACENTRAL_HOME=$RNACENTRAL_HOME
ENV RNACENTRAL_LOCAL=$RNACENTRAL_HOME/local
RUN mkdir -p $RNACENTRAL_HOME/local
RUN mkdir $RNACENTRAL_HOME/static
# Install Infernal
RUN \
cd $RNACENTRAL_LOCAL && \
curl -OL http://eddylab.org/infernal/infernal-1.1.1.tar.gz && \
tar -xvzf infernal-1.1.1.tar.gz && \
cd infernal-1.1.1 && \
./configure --prefix=$RNACENTRAL_LOCAL/infernal-1.1.1 && \
make && \
make install && \
cd easel && \
make install && \
cd $RNACENTRAL_LOCAL && \
rm infernal-1.1.1.tar.gz
# Download RNAcentral
RUN \
cd $RNACENTRAL_HOME && \
git clone https://github.com/RNAcentral/rnacentral-webcode.git
# Install Django requirements
RUN pip install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements.txt
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
# Install node.js dependencies
RUN cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
# Expose a container port where the website is served
EXPOSE 8000
# Start up the app
CMD python $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/manage.py runserver 0.0.0.0:8000
......@@ -5,7 +5,7 @@ services:
web:
build:
context: .
dockerfile: Dockerfile-kubernetes
dockerfile: Dockerfile-development
volumes:
- "rnacentral_data:/rnacentral"
environment:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment