-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
63 lines (48 loc) · 1.73 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM debian:stretch-slim as builder
MAINTAINER Dmitry Gadeev <[email protected]>
# Version of https://github.com/yandex/odyssey/issues/29#issuecomment-401326964
#
# ENV DEF_ODYSSEY_CONF /etc/odyssey/odyssey.conf
ENV ODYSSEY_VERSION 1.0rc1
WORKDIR /tmp/
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libssl-dev \
&& git clone --branch ${ODYSSEY_VERSION} --depth 1 git://github.com/yandex/odyssey.git \
&& cd odyssey \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& make
FROM debian:stretch-slim
ENV CONFDVERSION 0.16.0
RUN set -ex \
&& apt-get update \
&& apt-get install -y curl libssl1.1 \
&& curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v${CONFDVERSION}/confd-${CONFDVERSION}-linux-amd64 \
&& chmod +x /usr/local/bin/confd \
&& apt-get remove -y curl \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=builder /tmp/odyssey/build/sources/odyssey /usr/local/bin/
ENV ODYSSEY_LISTEN_PORT 5432
ENV ODYSSEY_MAXCLIENTS 2048
ENV ODYSSEY_POSTGRES_HOST localhost
ENV ODYSSEY_POSTGRES_PORT 5432
ENV ODYSSEY_POSTGRES_USERNAME postgres
ENV ODYSSEY_POSTGRES_PASSWORD postgrespassword
ENV ODYSSEY_POSTGRES_POOL_MODE transaction
ENV ODYSSEY_POSTGRES_POOL_SIZE 32
ENV ODYSSEY_POSTGRES_POOL_TIMEOUT 500 # msec
ENV ODYSSEY_POSTGRES_POOL_TTL 45 # sec
ADD odyssey.tmpl /etc/confd/templates/
ADD confd.toml /etc/confd/conf.d/
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
EXPOSE ${ODYSSEY_LISTEN_PORT}
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odyssey", "/opt/odyssey.conf"]