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

carlosribas's avatar
carlosribas committed
7
FROM debian:buster-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
17
    python3.7 \
    libpython3.7-dev \
    python3-pip \
carlosribas's avatar
carlosribas committed
18
19
    supervisor && \
    useradd -m -d /srv/rnacentral -s /bin/bash rnacentral
20

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

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

carlosribas's avatar
carlosribas committed
43
44
USER rnacentral

carlosribas's avatar
carlosribas committed
45
# Download RNAcentral, install requirements and node.js dependencies
46
RUN \
47
    cd $RNACENTRAL_HOME && \
carlosribas's avatar
carlosribas committed
48
49
50
51
    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 && \
    pip3 install gunicorn && \
carlosribas's avatar
carlosribas committed
52
    cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production
53

54
55
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
56

57
58
59
# Expose a container port where the website is served
EXPOSE 8000

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