Permalink
Browse files

Add simple deployment example using docker compose

  • Loading branch information...
Xarthisius committed Jul 11, 2016
1 parent d881368 commit a9cf6ffc67574d2fa2f207d1caf16ef9344cbe27
Showing with 57 additions and 2 deletions.
  1. +35 −0 Dockerfile
  2. +15 −0 docker-compose.yml
  3. +5 −0 docker.env
  4. +2 −2 girder_worker/__init__.py
View
@@ -0,0 +1,35 @@
FROM ubuntu:xenial
RUN apt-get update && \
apt-get install -qy software-properties-common python-software-properties && \
apt-get update && apt-get install -qy \
build-essential \
wget \
python \
libffi-dev \
libssl-dev \
libjpeg-dev \
zlib1g-dev \
libpython-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
WORKDIR /girder_worker
COPY setup.py /girder_worker/setup.py
COPY requirements.txt /girder_worker/requirements.txt
COPY README.rst /girder_worker/README.rst
COPY examples /girder_worker/examples
COPY scripts /girder_worker/scripts
COPY girder_worker /girder_worker/girder_worker
RUN pip install -r requirements.txt -e .
RUN useradd -D --shell=/bin/bash && useradd -m worker
RUN sed -i girder_worker/worker.local.cfg \
-e '/^broker/ s/guest@localhost/%(RABBITMQ_USER)s:%(RABBITMQ_PASS)s@%(RABBITMQ_HOST)s/'
RUN girder-worker-config set girder_worker tmp_root /tmp
USER worker
ENTRYPOINT ["python", "-m", "girder_worker"]
View
@@ -0,0 +1,15 @@
version: '2'
services:
broker:
image: rabbitmq:3
env_file: ./docker.env
worker:
build:
context: .
dockerfile: Dockerfile
links:
- broker:broker
env_file: ./docker.env
View
@@ -0,0 +1,5 @@
RABBITMQ_DEFAULT_USER=user
RABBITMQ_DEFAULT_PASS=password
RABBITMQ_USER=user
RABBITMQ_PASS=password
RABBITMQ_HOST=broker
@@ -6,7 +6,7 @@
from girder_worker.format import (
converter_path, get_validator_analysis, Validator)
from ConfigParser import ConfigParser
from ConfigParser import SafeConfigParser
from executors.python import run as python_run
from executors.workflow import run as workflow_run
from networkx import NetworkXNoPath
@@ -16,7 +16,7 @@
# Read the configuration files
_cfgs = ('worker.dist.cfg', 'worker.local.cfg')
config = ConfigParser()
config = SafeConfigParser(os.environ)
config.read([os.path.join(PACKAGE_DIR, f) for f in _cfgs])
# Maps task modes to their implementation

0 comments on commit a9cf6ff

Please sign in to comment.