FROM postgres:9.6.1

ENV STPROXY_CLUSTER_NAME=stolon-cluster \
    STPROXY_STORE_BACKEND=etcdv3 \
    STPROXY_STORE_ENDPOINTS=http://localhost:2379 \
    STPROXY_LISTEN_ADDRESS=0.0.0.0 \
    STPROXY_PORT=25432

COPY bin/stolon-proxy bin/stolonctl /usr/local/bin/
RUN chmod +x /usr/local/bin/stolon-proxy /usr/local/bin/stolonctl

USER postgres
ENTRYPOINT ["stolon-proxy"]
