-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
56 lines (48 loc) · 1.43 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
FROM node:8.5.0
WORKDIR /usr/src/app
ENV HAPROXY_MAJOR 1.7
ENV HAPROXY_VERSION 1.7.9
ENV HAPROXY_MD5 a2bbbdd45ffe18d99cdcf26aa992f92d
# copied from https://github.com/docker-library/haproxy/blob/394255fbe76c57a9f2e0775e3e69df714e801b46/1.7/Dockerfile
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpcre3 \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
\
&& buildDeps=' \
gcc \
libc6-dev \
libpcre3-dev \
libssl-dev \
make \
wget \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
&& wget -O haproxy.tar.gz "http://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haproxy-${HAPROXY_VERSION}.tar.gz" \
&& echo "$HAPROXY_MD5 *haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
\
&& makeOpts=' \
TARGET=linux2628 \
USE_OPENSSL=1 \
USE_PCRE=1 PCREDIR= \
USE_ZLIB=1 \
' \
&& make -C /usr/src/haproxy -j "$(nproc)" all $makeOpts \
&& make -C /usr/src/haproxy install-bin $makeOpts \
\
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/errors \
&& rm -rf /usr/src/haproxy \
\
&& apt-get purge -y --auto-remove $buildDeps
COPY package.json .
RUN npm install
COPY index.js .
EXPOSE 1339
CMD [ "npm", "start" ]