File tree Expand file tree Collapse file tree 5 files changed +26
-30
lines changed Expand file tree Collapse file tree 5 files changed +26
-30
lines changed Original file line number Diff line number Diff line change 1
1
FROM ubuntu:16.04
2
2
3
- ADD . /cesium
4
- WORKDIR /cesium
5
-
6
3
RUN apt-get update && \
4
+ apt-get install -y software-properties-common && \
5
+ add-apt-repository ppa:fkrull/deadsnakes && \
6
+ apt-get update && \
7
7
apt-get -y upgrade && \
8
- apt-get install -y python3 python3-venv libpq-dev libhdf5-serial-dev \
8
+ apt-get install -y python3.5 python3-venv libpq-dev libhdf5-serial-dev \
9
9
libnetcdf-dev supervisor libpython3-dev supervisor \
10
10
nginx npm nodejs && \
11
11
apt-get clean && \
12
12
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
13
- \
14
- python3 -m venv /cesium_env && \
13
+ useradd --create-home --shell /bin/bash cesium
14
+
15
+ RUN python3.5 -m venv /cesium_env && \
15
16
\
16
17
bash -c "source /cesium_env/bin/activate && \
17
18
pip install --upgrade pip && \
18
- pip install --upgrade pip && \
19
- export PIP_FIND_LINKS=http://wheels.scikit-image.org && \
19
+ pip install --upgrade pip"
20
+
21
+ ENV PIP_FIND_LINKS http://wheels.scikit-image.org
22
+ ADD . /cesium
23
+ WORKDIR /cesium
24
+
25
+ RUN bash -c "source /cesium_env/bin/activate && \
20
26
make paths && \
21
27
make dependencies && \
22
28
cp docker/cesium-docker.yaml . && \
23
- ln -s /usr/bin/nodejs /usr/bin/node"
29
+ ln -s /usr/bin/nodejs /usr/bin/node && \
30
+ chown -R cesium.cesium /cesium_env && \
31
+ chown -R cesium.cesium /cesium"
32
+
33
+ USER cesium
24
34
25
35
EXPOSE 5000
26
36
27
37
CMD bash -c "source /cesium_env/bin/activate && \
28
- make log & \
38
+ ( make log &) & & \
29
39
PYTHONPATH=. python -c \" from cesium_app.models import create_tables as c; c()\" && \
30
- supervisord -c conf/supervisord.conf "
40
+ make run "
31
41
Original file line number Diff line number Diff line change @@ -57,4 +57,4 @@ celery:
57
57
PYTHONPATH=" ./cesium_app" celery worker -A cesium_app.celery_app -l info & \
58
58
else \
59
59
echo " [Celery] is already running" ; \
60
- fi
60
+ fi
Original file line number Diff line number Diff line change 1
1
from celery import Celery
2
2
from cesium .celery_app import celery_config
3
3
4
- import os
5
- CELERY_BROKER = os .environ .get (
6
- 'CELERY_BROKER' , celery_config ['CELERY_BROKER' ])
7
-
8
4
celery_config ['CELERY_IMPORTS' ].append ('cesium_app.celery_tasks' )
9
5
#celery_config['CELERY_RESULT_DBURI'] = 'db+postgresql://cesium:cesium@localhost/cesium'
10
6
#celery_config['CELERY_RESULT_BACKEND'] = 'db+postgresql://cesium:cesium@localhost/cesium'
11
- app = Celery ('cesium_app' , broker = CELERY_BROKER )
7
+ app = Celery ('cesium_app' , broker = celery_config [ ' CELERY_BROKER' ] )
12
8
app .config_from_object (celery_config )
Original file line number Diff line number Diff line change 4
4
- " 9000:5000"
5
5
links :
6
6
- db
7
- - celery
7
+ - rabbit
8
8
volumes :
9
9
- .:/home/cesium_app
10
10
environment :
11
- - CELERY_BROKER=amqp://guest:guest@rabbit:5672/
11
+ - CELERY_BROKER=amqp://guest:guest@rabbit:5672//
12
12
# depends_on:
13
13
# - db
14
14
# - rabbit
15
- # - celery
16
15
17
16
db :
18
17
image : cesium/postgres
@@ -28,13 +27,3 @@ rabbit:
28
27
image : rabbitmq:3
29
28
ports :
30
29
- " 5672:5672"
31
-
32
- celery :
33
- image : celery
34
- # depends_on:
35
- # - rabbit
36
- links :
37
- - rabbit
38
- environment :
39
- - CELERY_BROKER=amqp://guest:guest@rabbit:5672/
40
- - CELERY_BROKER_URL=amqp://guest:guest@rabbit:5672/
Original file line number Diff line number Diff line change 10
10
pyjwt
11
11
plotly
12
12
simplejson
13
+ celery
You can’t perform that action at this time.
0 commit comments