Skip to content

Commit

Permalink
Support docker-compose for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPetrov committed May 20, 2019
1 parent aa83698 commit 28a84f0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 10 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ version: '2'
services:
producer:
restart: always
build: ./producer
build:
context: .
dockerfile: sequence_search/producer/Dockerfile
ports:
- "8002:8002"
depends_on:
- postgres
volumes:
- ./producer/producer:/producer
- ./:/rnacentral
environment:
ENVIRONMENT: "DOCKER-COMPOSE"
POSTGRES_USER: docker
Expand All @@ -22,12 +24,14 @@ services:

consumer:
restart: always
build: ./consumer
build:
context: .
dockerfile: sequence_search/consumer/Dockerfile
ports:
- "8000:8000"
- "8001:8001"
volumes:
- ./consumer/consumer:/consumer
- ./:/rnacentral
environment:
ENVIRONMENT: "DOCKER-COMPOSE"
HOST: "0.0.0.0"
Expand All @@ -36,6 +40,8 @@ services:
PRODUCER_PORT: "8002"
stdin_open: true
tty: true
depends_on:
- producer
# entrypoint: sleep infinity # if we need to debug

postgres:
Expand Down
6 changes: 4 additions & 2 deletions sequence_search/consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ RUN curl -OL http://eddylab.org/software/hmmer/hmmer-3.2.1.tar.gz && \
make install && \
cd easel; make install

ADD requirements.txt .
ADD sequence_search/requirements.txt .

RUN pip3 install -r requirements.txt

CMD python36 -m consumer.main
EXPOSE 8000

ENTRYPOINT cd /rnacentral && python36 -m sequence_search.consumer
6 changes: 4 additions & 2 deletions sequence_search/producer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ RUN yum install -y \

RUN easy_install-3.6 pip

ADD requirements.txt .
ADD sequence_search/requirements.txt .

RUN pip3 install -r requirements.txt

CMD python36 -m producer.models && python36 -m producer.main
EXPOSE 8002

ENTRYPOINT cd /rnacentral && python36 -m sequence_search.db && python3 -m sequence_search.producer

0 comments on commit 28a84f0

Please sign in to comment.