forked from autolab/Tango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
76 lines (60 loc) · 1.97 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
# Start with empty ubuntu machine
FROM ubuntu:15.04
MAINTAINER Autolab Development Team "autolab-dev@andrew.cmu.edu"
# Setup correct environment variable
ENV HOME /root
# Change to working directory
WORKDIR /opt
# Move all code into Tango directory
ADD . TangoService/Tango/
WORKDIR /opt/TangoService/Tango
RUN mkdir -p volumes
WORKDIR /opt
# Install dependancies
RUN apt-get update && apt-get install -y \
nginx \
curl \
git \
vim \
supervisor \
python-pip \
python-dev \
build-essential \
tcl8.5 \
wget \
libgcrypt11-dev \
zlib1g-dev \
apt-transport-https \
ca-certificates \
lxc \
iptables \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Redis
RUN wget http://download.redis.io/releases/redis-stable.tar.gz && tar xzf redis-stable.tar.gz
WORKDIR /opt/redis-stable
RUN make && make install
WORKDIR /opt/TangoService/Tango/
# Install Docker from Docker Inc. repositories.
RUN curl -sSL https://get.docker.com/ | sh
# Install the magic wrapper.
ADD ./wrapdocker /usr/local/bin/wrapdocker
RUN chmod +x /usr/local/bin/wrapdocker
# Define additional metadata for our image.
VOLUME /var/lib/docker
# Create virtualenv to link dependancies
RUN pip install virtualenv && virtualenv .
# Install python dependancies
RUN pip install -r requirements.txt
RUN mkdir -p /var/log/docker /var/log/supervisor
# Move custom config file to proper location
RUN cp /opt/TangoService/Tango/deployment/config/nginx.conf /etc/nginx/nginx.conf
RUN cp /opt/TangoService/Tango/deployment/config/supervisord.conf /etc/supervisor/supervisord.conf
RUN cp /opt/TangoService/Tango/deployment/config/redis.conf /etc/redis.conf
# Reload new config scripts
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
# TODO:
# volumes dir in root dir, supervisor only starts after calling start once , nginx also needs to be started
# Different log numbers for two different tangos
# what from nginx forwards requests to tango
# why does it still start on 3000