Skip to content

Commit 8eff2c5

Browse files
committed
Added Dockerfile and celery_workers.sh || TODO: User is not yet final, workers are on DEBUG and not on final form, missing obrv2 code, do the workers need to be ran with &
1 parent 6608a55 commit 8eff2c5

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM python:3.4
2+
3+
# installing necessary dependencies
4+
RUN apt-get -y update && apt-get install -y yui-compressor && apt-get install -y xvfb
5+
6+
# user creation
7+
RUN groupadd user && useradd --create-home --home-dir /home/user -g user user
8+
WORKDIR /home/user
9+
10+
# Somewhere here there is the need for the app to be installed
11+
# install celery just for testing purposes
12+
RUN pip install celery
13+
14+
# test celery worker. Note, we again need the app code installed to use
15+
# proper celery settings
16+
RUN pip install redis
17+
18+
RUN { \
19+
echo 'import os'; \
20+
echo "BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'amqp://')"; \
21+
} > celeryconfig.py
22+
23+
ENV CELERY_BROKER_URL amqp://guest@rabbit
24+
25+
COPY celery_workers.sh /home/user
26+
RUN chmod +x /home/user/celery_workers.sh
27+
28+
USER user
29+
30+
CMD ["/home/user/celery_workers.sh"]

celery_workers.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
celery worker -l DEBUG -Q boardbooks >> boardbooks.log
4+
celery worker -l DEBUG -Q documents >> documents.log
5+
celery worker -l DEBUG -Q notifications >> notifications.log
6+
celery worker -l DEBUG -Q thumbnails >> thumbnails.log
7+
celery worker -l DEBUG -Q validations >> validations.log

0 commit comments

Comments
 (0)