Skip to content

Commit 803ec9a

Browse files
committed
Add docker support
1 parent 8955458 commit 803ec9a

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

Dockerfile

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM centos:6.6
2+
3+
RUN yum install -y \
4+
curl \
5+
gcc \
6+
git \
7+
httpd \
8+
httpd-devel \
9+
libaio \
10+
nc.x86_64 \
11+
openssl \
12+
openssl-devel \
13+
tar \
14+
unzip \
15+
zlib-devel
16+
17+
RUN mkdir /rfam
18+
RUN mkdir /rfam/local
19+
20+
ENV LOC /rfam/local
21+
22+
# Install Python
23+
# NOTE: Python-2.7.11 and python-2.7.11 are DIFFERENT folders, the former contains the sources, the later - binaries
24+
RUN \
25+
cd $LOC && \
26+
curl -OL http://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz && \
27+
tar -zxvf Python-2.7.11.tgz && \
28+
cd Python-2.7.11 && \
29+
PREFIX=$LOC/python-2.7.11/ && \
30+
export LD_RUN_PATH=$PREFIX/lib && \
31+
./configure --prefix=$PREFIX --enable-shared && \
32+
make && \
33+
make install && \
34+
cd $LOC && \
35+
rm -Rf Python-2.7.11 && \
36+
rm Python-2.7.11.tgz
37+
38+
# Install virtualenv
39+
RUN \
40+
cd $LOC && \
41+
curl -OL https://pypi.python.org/packages/source/v/virtualenv/virtualenv-15.0.0.tar.gz && \
42+
tar -zxvf virtualenv-15.0.0.tar.gz && \
43+
cd virtualenv-15.0.0 && \
44+
$LOC/python-2.7.11/bin/python setup.py install && \
45+
cd $LOC && \
46+
rm -Rf virtualenv-15.0.0.tar.gz && \
47+
rm -Rf virtualenv-15.0.0
48+
49+
# Create virtual environment
50+
RUN \
51+
cd $LOC && \
52+
mkdir virtualenvs && \
53+
cd virtualenvs && \
54+
$LOC/python-2.7.11/bin/virtualenv rfam-production --python=$LOC/python-2.7.11/bin/python
55+
56+
# Define container environment variables
57+
ENV PYTHONPATH /rfam/rfam-production
58+
59+
# Install Python requirements
60+
ADD requirements.txt $RFAM_PRODUCTION
61+
RUN \
62+
source $LOC/virtualenvs/rfam-production/bin/activate && \
63+
pip install -r $RFAM_PRODUCTION/requirements.txt
64+
65+
COPY entrypoint.sh /entrypoint.sh
66+
RUN chmod 700 entrypoint.sh
67+
68+
ENTRYPOINT ["/entrypoint.sh"]

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ and validation.
1515
* **Validation:** Data validation scripts
1616
* **Utils:** Support modules/utilities
1717

18+
### Using with Docker
19+
20+
* build container
21+
```
22+
docker build -t rfam-production .
23+
```
24+
25+
* open bash interactive shell
26+
```
27+
docker run -v `pwd`:/rfam/rfam-production -it rfam-production bash
28+
```
29+
30+
* run a command inside the container
31+
```
32+
docker run -v `pwd`:/rfam/rfam-production -it rfam-production python scripts/export/rfam_xml_dumper.py --out /rfam --type R
33+
```
34+
1835
### Installation
1936

2037
```

entrypoint.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
source $LOC/virtualenvs/rfam-production/bin/activate
3+
cd $PYTHONPATH
4+
exec "$@"

0 commit comments

Comments
 (0)