forked from BetterVoice/pgpool2-container
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
45 lines (34 loc) · 1.59 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
# Pgpool2.
FROM hegand/alpine:edge
ENV PGPOOL_VERSION 3.5.4
ENV PG_VERSION 9.6.0-r1
ENV LANG en_US.utf8
RUN apk --update --no-cache add libpq=${PG_VERSION} postgresql-dev=${PG_VERSION} postgresql-client=${PG_VERSION} \
linux-headers gcc make libgcc g++ \
libffi-dev python python-dev py2-pip libffi-dev && \
cd /tmp &&\
wget http://www.pgpool.net/mediawiki/images/pgpool-II-${PGPOOL_VERSION}.tar.gz -O - | tar -xz && \
chown root:root -R /tmp/pgpool-II-${PGPOOL_VERSION} && \
cd /tmp/pgpool-II-${PGPOOL_VERSION} && \
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info && \
make && \
make install && \
rm -rf /tmp/pgpool-II-${PGPOOL_VERSION} && \
apk del postgresql-dev linux-headers gcc make libgcc g++
RUN pip install Jinja2
RUN mkdir /etc/pgpool2 /var/run/pgpool /var/log/pgpool /var/run/postgresql /var/log/postgresql/ && \
chown postgres /etc/pgpool2 /var/run/pgpool /var/log/pgpool /var/run/postgresql /var/log/postgresql
# Post Install Configuration.
ADD bin/configure-pgpool2 /usr/bin/configure-pgpool2
RUN chmod +x /usr/bin/configure-pgpool2
ADD conf/pcp.conf.template /usr/share/pgpool2/pcp.conf.template
ADD conf/pgpool.conf.template /usr/share/pgpool2/pgpool.conf.template
# Start the container.
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 9999 9898
CMD ["pgpool","-n", "-f", "/etc/pgpool2/pgpool.conf", "-F", "/etc/pgpool2/pcp.conf"]