I have the following docker container:
FROM debian:stretch-backports
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ruby ruby-dev \
curl wget \
gnupg \
git \
ncbi-blast+
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get update && apt-get install -y --no-install-recommends \
nodejs npm && \
rm -rf /var/lib/apt/lists/*
RUN wget -c https://github.com/wurmlab/sequenceserver/archive/1.1.0.beta10.tar.gz && \
apt-get update && apt-get install -y --no-install-recommends zlib1g-dev && \
gem install bundler && \
tar xfvz 1.1.0.beta10.tar.gz && \
cd sequenceserver-1.1.0.beta10 && \
npm install && \
bundle install
#RUN mkdir /db
VOLUME ["/db"]
EXPOSE 4567
WORKDIR /sequenceserver-1.1.0.beta10
ENTRYPOINT ["bundle", "exec", "bin/sequenceserver", "-d", "/db"]
When I start the container it asks me interactively questions in order to set up the database:
$ docker run --rm -ti -p 4567:4567 -v $(pwd)/db:/db seqserver
fatal: Not a git repository (or any of the parent directories): .git
Could not find BLAST+ databases in: /db.
Search for FASTA files (.fa, .fasta, .fna) in '/db' and try
creating BLAST+ databases? [y/n] (Default: y).
>> y
Searching ...
FASTA file: /db/sequence.fasta
FASTA type: nucleotide
Proceed? [y/n] (Default: y): y
Enter a database title or will use 'sequence': Escherichia coli str. K-12 substr. MG1655, complete genome
Enter taxid (optional):
Building a new DB, current time: 07/02/2018 00:37:08
New DB name: /db/sequence.fasta
New DB title: Escherichia coli str. K-12 substr. MG1655, complete genome
Sequence type: Nucleotide
Keep MBits: T
Maximum file size: 1000000000B
Adding sequences from FASTA; added 1 sequences in 0.487213 seconds.
SEF-EEB-123137:sequenceserver lorencm$ ls db
sequence.fasta sequence.fasta.nhi sequence.fasta.nin sequence.fasta.nsd sequence.fasta.nsq
sequence.fasta.nhd sequence.fasta.nhr sequence.fasta.nog sequence.fasta.nsi
SEF-EEB-123137:sequenceserver lorencm$ docker run --rm -ti -p 4567:4567 -v $(pwd)/db:/db seqserver
fatal: Not a git repository (or any of the parent directories): .git
[2018-07-02 00:37:33] WARN Will listen on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--host option).
** SequenceServer is ready.
Go to http://localhost:4567 in your browser and start BLASTing!
Press CTRL+C to quit.
Next, I want to use the above Dockerfile with docker-compose
$ cat docker-compose.yml
sequenceserver:
build: sequenceserver
# restart: always
ports:
- "4567:4567"
volumes:
- ./data/sequenceserver:/db
but unfortunately I do not get the questions anymore only the following output:
$ docker-compose up
...
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
sequenceserver_1 | Enter taxid (optional): taxid should be a number
How is possible to do interactive setup with docker-compose or is there another way?
Thank you in advance.