-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
43 lines (32 loc) · 1.21 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
FROM haproxy:2.0
LABEL maintainer="Anton Markelov <[email protected]>"
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ARG STOLONCTL_VERSION=0.13.0
#install python, wget, supervisor
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
supervisor \
wget && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
#install script requirements
COPY requirements.txt /app/requirements.txt
RUN pip3 install --no-cache-dir -r /app/requirements.txt
#install stolonctl
ADD https://github.com/sorintlab/stolon/releases/download/v${STOLONCTL_VERSION}/stolon-v${STOLONCTL_VERSION}-linux-amd64.tar.gz /tmp/stolon.tar.gz
RUN tar zxvf /tmp/stolon.tar.gz -C /tmp && \
mv /tmp/stolon-v${STOLONCTL_VERSION}-linux-amd64/bin/stolonctl /usr/bin/stolonctl && \
chmod +x /usr/bin/stolonctl
COPY docker/config.yml /app/config.yml
COPY docker/haproxy.cfg /usr/local/etc/haproxy/config.cfg
COPY docker/stolon_haproxy.j2 /app/stolon_haproxy.j2
RUN touch /usr/local/etc/haproxy/stolon-config.cfg
COPY docker/supervisord.conf /app/supervisord.conf
COPY src /app/src
EXPOSE 35432 18181
CMD ["supervisord", "-c", "/app/supervisord.conf"]