forked from klaemo/docker-couchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (76 loc) · 3.02 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
FROM debian:jessie
MAINTAINER Clemens Stolle [email protected]
# Add CouchDB user account
RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
haproxy \
erlang-nox \
erlang-reltool \
libicu52 \
libmozjs185-1.0 \
haproxy \
python \
openssl \
&& rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root and tini for signal handling
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 \
&& curl -o /usr/local/bin/tini -fSL "https://github.com/krallin/tini/releases/download/v0.9.0/tini" \
&& curl -o /usr/local/bin/tini.asc -fSL "https://github.com/krallin/tini/releases/download/v0.9.0/tini.asc" \
&& gpg --verify /usr/local/bin/tini.asc \
&& rm /usr/local/bin/tini.asc \
&& chmod +x /usr/local/bin/tini
ENV COUCHDB_VERSION 2.0.0
# Download dev dependencies
RUN apt-get update -y -qq && apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
erlang-dev \
libcurl4-openssl-dev \
libicu-dev \
libmozjs185-dev \
&& curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo 'deb https://deb.nodesource.com/node_4.x jessie main' > /etc/apt/sources.list.d/nodesource.list \
&& echo 'deb-src https://deb.nodesource.com/node_4.x jessie main' >> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -y -qq \
&& apt-get install -y nodejs \
&& npm install -g grunt-cli \
# Acquire CouchDB source code
&& cd /usr/src && mkdir couchdb \
&& curl -fSL https://dist.apache.org/repos/dist/dev/couchdb/source/2.0.0/rc.1/apache-couchdb-$COUCHDB_VERSION.tar.gz -o couchdb.tar.gz \
&& tar -xzf couchdb.tar.gz -C couchdb --strip-components=1 \
&& cd couchdb \
# Build the release and install
&& ./configure --disable-docs \
&& make release \
# Cleanup build detritus
&& apt-get purge -y \
binutils \
build-essential \
cpp \
erlang-dev \
git \
libicu-dev \
make \
nodejs \
perl \
&& apt-get autoremove -y && apt-get clean \
&& apt-get install -y libicu52 --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /usr/lib/node_modules
# Setup directories and permissions
RUN chmod +x /usr/src/couchdb/dev/run && chown -R couchdb:couchdb /usr/src/couchdb
WORKDIR /usr/src/couchdb
EXPOSE 5984 4369 9100 15984 25984 35984 15986 25986 35986
CMD ["tini", "--", "/usr/src/couchdb/dev/run", "--with-haproxy"]