Dockerfile-local 1.82 KB
Newer Older
carlosribas's avatar
carlosribas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#------------------------------------------------------------------------------
#
# This Dockerfile is meant for containerized deployment with Kubernetes.
#
#-------------------------------------------------------------------------------

FROM python:3.8-slim

RUN apt-get update && apt-get install -y \
    g++ \
    build-essential \
    curl \
    tar \
    git \
    vim \
    supervisor && \
    rm -rf /var/lib/apt/lists/*

ENV RNACENTRAL_LOCAL=/srv/rnacentral/local
ENV SUPERVISOR_CONF_DIR=/srv/rnacentral/supervisor

# Create folders
RUN \
    mkdir -p $RNACENTRAL_LOCAL && \
    mkdir -p $SUPERVISOR_CONF_DIR && \
    mkdir /srv/rnacentral/log && \
    mkdir /srv/rnacentral/static

# Install Infernal and node.js
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 && \
    curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
    apt-get install -y nodejs

# Set work directory
ENV RNACENTRAL_HOME=/srv/rnacentral/rnacentral-webcode
RUN mkdir -p $RNACENTRAL_HOME
WORKDIR $RNACENTRAL_HOME

# Copy requirements
COPY rnacentral/requirements* .

# Install requirements
RUN pip3 install -r requirements.txt && pip3 install -r requirements_dev.txt

# Install NPM dependencies
ADD rnacentral/portal/static/package.json rnacentral/portal/static/
RUN cd rnacentral/portal/static && npm install --only=production

# Run entrypoint
COPY ./entrypoint-local.sh /
62
RUN chmod 744 /entrypoint-local.sh
carlosribas's avatar
carlosribas committed
63 64 65 66
ENTRYPOINT ["/entrypoint-local.sh"]

# Supervisor
CMD [ "/bin/sh", "-c", "/usr/bin/supervisord -c ${SUPERVISOR_CONF_DIR}/supervisord.conf" ]