Dockerfile 1.83 KB
Newer Older
1
#------------------------------------------------------------------------------
2
#
3
# This Dockerfile is meant for containerized deployment with Kubernetes.
4
#
5
#-------------------------------------------------------------------------------
6

7
FROM python:3.7-slim
8

9
10
11
RUN apt-get update && apt-get install -y \
    g++ \
    build-essential \
12
    curl \
13
14
    tar \
    git \
carlosribas's avatar
carlosribas committed
15
16
    supervisor && \
    useradd -m -d /srv/rnacentral -s /bin/bash rnacentral
17

18
ENV RNACENTRAL_HOME=/srv/rnacentral
19
ENV RNACENTRAL_LOCAL=$RNACENTRAL_HOME/local
carlosribas's avatar
carlosribas committed
20
ENV SUPERVISOR_CONF_DIR=${SUPERVISOR_CONF_DIR:-"/srv/rnacentral/supervisor"}
carlosribas's avatar
carlosribas committed
21
ARG RNACENTRAL_BRANCH
22

carlosribas's avatar
carlosribas committed
23
# Create folders. Install Infernal and node.js
24
RUN \
carlosribas's avatar
carlosribas committed
25
    mkdir -p $RNACENTRAL_HOME/local && \
26
    cd $RNACENTRAL_LOCAL && \
27
28
29
    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 && \
30
    ./configure --prefix=$RNACENTRAL_LOCAL/infernal-1.1.1 && \
31
32
33
34
    make && \
    make install && \
    cd easel && \
    make install && \
35
    cd $RNACENTRAL_LOCAL && \
carlosribas's avatar
carlosribas committed
36
    rm infernal-1.1.1.tar.gz && \
carlosribas's avatar
carlosribas committed
37
    curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
carlosribas's avatar
carlosribas committed
38
    apt-get install -y nodejs
39

carlosribas's avatar
carlosribas committed
40
41
USER rnacentral

carlosribas's avatar
carlosribas committed
42
# Download RNAcentral, install requirements and node.js dependencies
43
RUN \
44
    cd $RNACENTRAL_HOME && \
carlosribas's avatar
carlosribas committed
45
46
47
    BRANCH="${RNACENTRAL_BRANCH:-master}" && \
    git clone -b "$BRANCH" https://github.com/RNAcentral/rnacentral-webcode.git && \
    pip3 install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements.txt && \
48
49
    cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production && \
    mkdir $RNACENTRAL_HOME/static
50

51
WORKDIR $RNACENTRAL_HOME/rnacentral-webcode
52
53
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
54

carlosribas's avatar
carlosribas committed
55
CMD [ "/bin/sh", "-c", "/usr/bin/supervisord -c ${SUPERVISOR_CONF_DIR}/supervisord.conf" ]