forked from rapidpro/rapidpro
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
90 lines (73 loc) · 2.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM mvilchis/rapidpro-base:v1.0
MAINTAINER Miguel Vilchis "[email protected]"
################# Enviroment variables #################
ENV C_FORCE_ROOT True
ENV UWSGI_WSGI_FILE=temba/wsgi.py
ENV UWSGI_HTTP=:8000
ENV UWSGI_MASTER=1
ENV UWSGI_WORKERS=8
ENV UWSGI_HARAKIRI=20
ENV LANG C.UTF-8
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
################# Install packages #################
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
patch \
git \
gcc \
g++ \
make \
curl \
libc-dev \
musl-dev \
libpng-dev \
libxslt-dev \
libxml2-dev \
libffi-dev \
ncurses-dev \
nodejs \
npm \
nodejs-legacy \
python3.6 \
idle3 \
python3.6-dev \
build-essential \
vim \
wget \
libpq-dev \
file \
lib32ncurses5-dev \
libgeos-dev && \
rm -rf /var/lib/apt/lists/* && \
npm install -g less && \
npm install -g coffee-script && \
npm install -g bower
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
################# Work directory #################
RUN mkdir rapidpro
WORKDIR /rapidpro
COPY pip-freeze.txt /rapidpro
COPY pip-requires.txt /rapidpro
################# Install requirements #################
RUN pip3 install --no-cache-dir --upgrade pip
#RUN pip install --upgrade pip==9.0.3 && \
RUN python3.6 -m pip install --upgrade setuptools
RUN python3.6 -m pip install -r pip-freeze.txt
################# Remove pyhthon3.5 link #################
RUN rm /usr/bin/python3
RUN ln -s /usr/bin/python3.6 /usr/bin/python3
################# Add files #################
ADD . /rapidpro
RUN cp temba/settings.py.dev temba/settings.py
################# Set configuration #################
RUN sed -i 's/sitestatic\///' /rapidpro/static/brands/rapidpro/less/style.less
RUN sed -i '/ - for obj in object_list/c\ - for obj in object_list\n \ - if obj.id >= 0' templates/smartmin/list.haml
EXPOSE 8000
EXPOSE 5555
CMD ["./start.sh"]