Commit b8768c68 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

adding docker-compose for multi-service setup

parent 992dcfe7
......@@ -10,14 +10,8 @@ RUN apt-get update \
python3.5-dev \
python3-pip \
python3-setuptools \
rabbitmq-server \
redis-server \
r-bioc-limma
RUN pip3 install wheel
RUN pip3 install -e /app --default-timeout 180
RUN /etc/init.d/redis-server start
RUN /etc/init.d/rabbitmq-server start
RUN celery worker -A fractalis:celery -D -l info
EXPOSE 5000
CMD ["python3", "fractalis/__init__.py"]
FROM buildpack-deps:stretch
WORKDIR /app
COPY . /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
r-base \
python3.5 \
python3.5-dev \
python3-pip \
python3-setuptools \
r-bioc-limma
RUN pip3 install wheel
RUN pip3 install -e /app --default-timeout 180
CMD ["celery", "worker", "-A", "fractalis:celery"]
version: '3'
services:
web:
build:
context: .
dockerfile: Dockerfile-web
environment:
- FRACTALIS_CONFIG=${FRACTALIS_CONFIG}
- REDIS_HOST=redis
- RABBITMQ_HOST=rabbitmq
ports:
- '5000:5000'
worker:
build:
context: .
dockerfile: Dockerfile-worker
environment:
- FRACTALIS_CONFIG=${FRACTALIS_CONFIG}
- REDIS_HOST=redis
- RABBITMQ_HOST=rabbitmq
redis:
image: 'redis:alpine'
rabbitmq:
image: 'rabbitmq:alpine'
......@@ -8,7 +8,7 @@ from datetime import timedelta
SECRET_KEY = 'OVERWRITE ME IN PRODUCTION!!!'
DEBUG = False
TESTING = False
REDIS_HOST = '127.0.0.1'
REDIS_HOST = os.environ.get('REDIS_HOST') or '127.0.0.1'
REDIS_PORT = '6379'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = False
......@@ -16,7 +16,8 @@ SESSION_REFRESH_EACH_REQUEST = True
PERMANENT_SESSION_LIFETIME = timedelta(days=1)
# Celery
BROKER_URL = 'amqp://'
RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST') or '127.0.0.1'
BROKER_URL = 'amqp://guest:guest@{}:5672//'.format(RABBITMQ_HOST)
CELERY_RESULT_BACKEND = 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT)
CELERYD_TASK_SOFT_TIME_LIMIT = 60 * 20
CELERYD_TASK_TIME_LIMIT = 60 * 30
......
......@@ -24,7 +24,8 @@ setup(
'requests==2.18.4',
'PyYAML==3.12',
'pycryptodomex==3.4.7',
'rpy2==2.9.0'
'rpy2==2.9.0',
'flake8==3.5.0'
],
setup_requires=[
'pytest-runner==2.12.1',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment