-
Notifications
You must be signed in to change notification settings - Fork 113
/
Dockerfile
35 lines (29 loc) · 1.15 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
FROM ubuntu:trusty
MAINTAINER Bernardo Pericacho <[email protected]> && Feng Honglin <[email protected]>
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common && add-apt-repository ppa:vbernat/haproxy-1.5
# Install required packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y haproxy python-pip
# Add configuration and scripts
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ADD main.py /main.py
ADD run.sh /run.sh
RUN chmod 755 /*.sh
ADD conf/haproxy.cfg.json /etc/haproxy/haproxy.cfg.json
ADD conf/haproxy.cfg.json /etc/haproxy/empty_haproxy.cfg.json
# PORT to load balance and to expose (also update the EXPOSE directive below)
ENV PORT 80
# MODE of operation (http, tcp)
ENV MODE http
# algorithm for load balancing (roundrobin, source, leastconn, ...)
ENV BALANCE roundrobin
# maximum number of connections
ENV MAXCONN 4096
# list of options separated by commas
ENV OPTIONS redispatch
# list of timeout entries separated by commas
ENV TIMEOUTS connect 5000,client 50000,server 50000
# SSL certificate to use (optional)
ENV SSL_CERT **None**
EXPOSE 80
CMD ["/run.sh"]