-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (47 loc) · 1.68 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
FROM python:3.7
ADD . /tmp
# Install unzip
RUN apt-get update && apt-get -y upgrade && apt-get install -y apt-utils unzip
#### INSTALL PROTOC
# stolen from https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8
# Make sure you grab the latest version
RUN curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
RUN unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
RUN mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
RUN mv protoc3/include/* /usr/local/include/
#### TEST IT
CMD protoc --version
### INSTALL NPM, protobuf-jsonschema
RUN apt-get install -y npm nodejs
RUN npm -v
RUN npm install protobuf-jsonschema -g
#### INSTALL REDIS, STOLEN FROM https://github.com/dockerfile/redis/blob/master/Dockerfile
RUN \
cd /tmp && \
wget http://download.redis.io/redis-stable.tar.gz && \
tar xvzf redis-stable.tar.gz && \
cd redis-stable && \
make && \
make install && \
cp -f src/redis-sentinel /usr/local/bin && \
mkdir -p /etc/redis && \
cp -f *.conf /etc/redis && \
rm -rf /tmp/redis-stable* && \
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
#need pip > 8 to have internal pypi repo in requirements.txt
RUN pip install --upgrade pip
##### INSTALL THIS APP
WORKDIR /tmp
RUN pip install -r requirements.txt
RUN pip install .
EXPOSE 5006
RUN mkdir /tmp/protofiles
RUN chmod 777 /tmp/protofiles
#START REDIS, AND THE APP
CMD redis-server --daemonize yes; run.py