File tree 8 files changed +105
-7
lines changed
8 files changed +105
-7
lines changed Original file line number Diff line number Diff line change
1
+ node_modules
2
+ client /node_modules
3
+ .dockerignore
4
+ Dockerfile
5
+ npm-debug.log
6
+ .git
7
+ .hg
8
+ .svn
Original file line number Diff line number Diff line change @@ -29,3 +29,4 @@ tests/geo/*.xlsx
29
29
* .pid
30
30
dump.rdb
31
31
config.py
32
+ client /package-lock.json
Original file line number Diff line number Diff line change
1
+ FROM continuumio/anaconda3:latest
2
+
3
+ RUN groupadd -g 999 appuser && \
4
+ useradd -m -r -u 999 -g appuser appuser
5
+
6
+ ADD . /app
7
+ WORKDIR /app
8
+
9
+ RUN python3 -m ensurepip
10
+
11
+ # Prevent nginx from starting automatically
12
+ RUN ln -s /dev/null /etc/systemd/system/nginx.service
13
+
14
+ RUN apt-get update -y
15
+ RUN apt-get install -y apt-utils redis-server supervisor nginx libpq-dev gcc g++ make build-essential
16
+
17
+ RUN curl -sL https://deb.nodesource.com/setup_9.x | bash
18
+ RUN apt-get install -yqq nodejs
19
+ RUN apt-get clean -y
20
+
21
+ # RUN python3 -m pip install celery==4.2.2 # Because Celery 4.3 is broken
22
+ RUN pip install -r server/localrequirements.txt
23
+ RUN python3 setup.py develop
24
+
25
+ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
26
+ RUN rm -f /etc/nginx/conf.d/*
27
+ RUN rm -f /etc/nginx/sites-enabled/*
28
+ COPY build/nginx.conf /etc/nginx/conf.d/nginx.conf
29
+
30
+ RUN rm -rf client/node_modules
31
+ RUN npm install -g bower
32
+ RUN npm install -g gulp
33
+
34
+ COPY server/config.example.py server/config.py
35
+ RUN ./bin/build_client.sh
36
+
37
+ EXPOSE 80 443
38
+
39
+ RUN chown -R appuser:appuser .
40
+ CMD supervisord
Original file line number Diff line number Diff line change 41
41
if [ -d " source/vendor" ]; then
42
42
if [ -d " node_modules/bower/bin" ]; then
43
43
echo -e ' \nPruning bower modules...'
44
- node_modules/bower/bin/bower prune
44
+ node_modules/bower/bin/bower prune --allow-root
45
45
fi
46
46
fi
47
47
48
48
# install npm and bower deps
49
49
echo -e ' \nInstalling npm dependencies...'
50
50
npm install --skip-installed
51
+ node_modules/bower/bin/bower install --allow-root
51
52
52
53
# compile sass scripts and minify javascript and copy client and everything
53
54
echo -e ' \nCompiling client (including minifying JavaScript)...'
Original file line number Diff line number Diff line change 10
10
"bower" : " =1.5.3" ,
11
11
"csswring" : " =4.0.0" ,
12
12
"event-stream" : " =3.3.1" ,
13
- "gulp" : " =3.9.0" ,
14
13
"gulp-concat" : " =2.6.0" ,
15
14
"gulp-css-globbing" : " =0.1.8" ,
16
15
"gulp-livereload" : " =3.8.1" ,
21
20
"gulp-regex-replace" : " ^0.2.3" ,
22
21
"gulp-replace" : " ^0.5.4" ,
23
22
"gulp-requirejs" : " =0.1.3" ,
24
- "gulp-sass" : " =2 .0.4 " ,
23
+ "gulp-sass" : " ^4 .0.0 " ,
25
24
"gulp-uglify" : " =1.4.1" ,
26
25
"gulp-util" : " =3.0.6" ,
27
26
"postcss-assets" : " =3.0.3" ,
28
27
"postcss-import" : " =7.0.0" ,
29
28
"underscore" : " =1.8.3"
30
29
},
31
- "scripts" : {
32
- "postinstall" : " bower install"
33
- },
34
30
"dependencies" : {
35
31
"gulp" : " ^3.9.1"
36
32
}
Original file line number Diff line number Diff line change 87
87
margin-right : 40px ;
88
88
}
89
89
90
+ /* FIXME
90
91
&.invalid {
91
92
border: solid #FF0000 1px;
92
93
outline: 0px;
93
94
}
95
+ */
94
96
95
97
.c-caption {
96
98
text-align : center ;
Original file line number Diff line number Diff line change 4
4
import multiprocessing
5
5
import math
6
6
7
- SQLALCHEMY_DATABASE_URI = os .getenv ('SQLALCHEMY_DATABASE_URI' ,'postgresql+psycopg2://optima:optima@localhost :5432/optima' )
7
+ SQLALCHEMY_DATABASE_URI = os .getenv ('SQLALCHEMY_DATABASE_URI' ,'postgresql+psycopg2://optima:optima@vladh.net :5432/optima' )
8
8
SECRET_KEY = os .getenv ('SECRET_KEY' ,'F12Zr47j\3 yX R~X@H!jmM]Lwf/,?KT' )
9
9
UPLOAD_FOLDER = os .getenv ('UPLOAD_FOLDER' ,'/tmp/uploads' )
10
10
REDIS_URL = os .getenv ('REDIS_URL' , 'redis://127.0.0.1:6379/4' ) # Shortcut for setting both the celery broker and result backend cache
Original file line number Diff line number Diff line change
1
+ [supervisord]
2
+ nodaemon=true
3
+
4
+ [program:celery]
5
+ command=celery -A server.webapp.tasks.celery_instance worker -l info
6
+ stdout_logfile=/dev/stdout
7
+ stdout_logfile_maxbytes=0
8
+ stdout_logfile=/dev/stderr
9
+ stdout_logfile_maxbytes=0
10
+ user=appuser
11
+ autostart=true
12
+ autorestart=true
13
+ startsecs=10
14
+ stopwaitsecs=600
15
+ killasgroup=true
16
+ priority=500
17
+
18
+ [program:app]
19
+ command=python -m server._twisted_wsgi 8080
20
+ stdout_logfile=nutrition_stdout.log
21
+ stdout_logfile_maxbytes=0
22
+ stdout_logfile=nutrition_stderr.log
23
+ stdout_logfile_maxbytes=0
24
+ user=appuser
25
+ autostart=true
26
+ autorestart=true
27
+ startsecs=10
28
+ stopwaitsecs=600
29
+
30
+ [program:nginx]
31
+ command=/usr/sbin/nginx
32
+ stdout_logfile=/dev/stdout
33
+ stdout_logfile_maxbytes=0
34
+ stderr_logfile=/dev/stderr
35
+ stderr_logfile_maxbytes=0
36
+ autostart=true
37
+ autorestart=true
38
+ startsecs=10
39
+ stopwaitsecs=600
40
+
41
+ [program:redis]
42
+ command=redis-server
43
+ stdout_logfile=/dev/stdout
44
+ stdout_logfile_maxbytes=0
45
+ stderr_logfile=/dev/stderr
46
+ stderr_logfile_maxbytes=0
47
+ autostart=true
48
+ autorestart=true
49
+ startsecs=10
50
+ stopwaitsecs=600
You can’t perform that action at this time.
0 commit comments