-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
47 lines (35 loc) · 1.13 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
FROM ubuntu:18.04
MAINTAINER melvinkcx at gmail dot com
# Fix timezone issue, see: https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1554806
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
# RUN dpkg-reconfigure -f noninteractive tzdata
RUN apt update --fix-missing
RUN apt install -y postgresql postgresql-server-dev-10 build-essential curl python-pip psmisc
RUN pip install awscli
WORKDIR /tmp
RUN curl -L -o pgpool-II-4.0.6.tar.gz http://www.pgpool.net/download.php?f=pgpool-II-4.0.6.tar.gz
RUN tar xf pgpool-II-4.0.6.tar.gz
WORKDIR /tmp/pgpool-II-4.0.6
RUN ./configure
RUN make
RUN make install
WORKDIR /tmp/pgpool-II-4.0.6/src/sql
RUN make
RUN make install
RUN rm -rf /tmp/*
RUN mkdir -p /var/run/pgpool
RUN mkdir -p /var/log/pgpool
RUN chmod -R 777 /var/run/pgpool
RUN chmod -R 777 /var/run/pgpool
ENV MASTER_NODE_PORT 5432
ENV REPLICA_NODE_PORT 5432
ENV DB_NAME postgres
ENV DB_USERNAME postgres
ENV DB_PASSWORD postgres
EXPOSE 9999
EXPOSE 9000
WORKDIR /usr/local/bin
COPY docker-entrypoint.sh /usr/local/bin
RUN chmod 777 ./docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["pgpool", "-n", "-D"]