This is an automated email from the ASF dual-hosted git repository. garren pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit efff00e2d3deee38a016b99ee03a956d5cbc6c72 Author: Adam Kocoloski <[email protected]> AuthorDate: Thu Apr 28 22:09:17 2016 -0400 Add Dockerfile for CouchDB 2.0 production Unlike the 2.0-dev build, which results in a fully-connected 3 node cluster inside the container, this Dockerfile builds a minimal Erlang release using reltool, installs that release into /opt/couchdb, and runs just the one single Erlang VM. Orchestrating a cluster of these is out of scope. closes #52 closes #56 --- 2.0-prod/Dockerfile | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 2.0-prod/couchdb.config | 21 +++++++++++++ 2.0-prod/local.ini | 8 +++++ 2.0-prod/vm.args | 28 +++++++++++++++++ 4 files changed, 141 insertions(+) diff --git a/2.0-prod/Dockerfile b/2.0-prod/Dockerfile new file mode 100644 index 0000000..fb998c7 --- /dev/null +++ b/2.0-prod/Dockerfile @@ -0,0 +1,84 @@ +# 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 +# +# http://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] + +ENV COUCHDB_VERSION master + + +RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb + +# Download dependencies +RUN apt-get update -y -qq && apt-get install -y --no-install-recommends \ + apt-transport-https \ + build-essential \ + ca-certificates \ + curl \ + erlang-dev \ + erlang-nox \ + erlang-reltool \ + git \ + haproxy \ + libcurl4-openssl-dev \ + libicu-dev \ + libmozjs185-dev \ + openssl \ + python \ + && 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 and configure CouchDB source code + && cd /usr/src \ + && git clone --depth 1 https://git-wip-us.apache.org/repos/asf/couchdb.git \ + && cd couchdb \ + && git checkout $COUCHDB_VERSION \ + && ./configure \ + --disable-docs \ + --databasedir /var/lib/couchdb \ + --viewindexdir /var/lib/couchdb \ +# Build the release and install into /opt + && make build \ + && mv /usr/src/couchdb/rel/couchdb /opt/ \ + && mkdir -p /var/lib/couchdb \ + && chown -R couchdb:couchdb /opt/couchdb /var/lib/couchdb \ +# 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 /usr/src/couchdb + +# Now override some of the configuration +COPY local.ini /opt/couchdb/etc/ +COPY vm.args /opt/couchdb/etc/ +RUN chown couchdb:couchdb /opt/couchdb/etc/* + +VOLUME ["/var/lib/couchdb"] +USER couchdb +EXPOSE 5984 +EXPOSE 4369 +EXPOSE 9100 +WORKDIR /opt/couchdb + +ENTRYPOINT ["/opt/couchdb/bin/couchdb"] diff --git a/2.0-prod/couchdb.config b/2.0-prod/couchdb.config new file mode 100644 index 0000000..7c0fa6b --- /dev/null +++ b/2.0-prod/couchdb.config @@ -0,0 +1,21 @@ +% 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 +% +% http://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. +% +{package_author_name, "The Apache Software Foundation"}. +{prefix, "."}. +{data_dir, "/var/lib/couchdb"}. +{view_index_dir, "/var/lib/couchdb"}. +{log_file, ""}. +{fauxton_root, "./share/www"}. +{user, "couchdb"}. +{cluster_port, 5984}. +{backend_port, 5986}. diff --git a/2.0-prod/local.ini b/2.0-prod/local.ini new file mode 100644 index 0000000..1aa633c --- /dev/null +++ b/2.0-prod/local.ini @@ -0,0 +1,8 @@ +; CouchDB Configuration Settings + +; Custom settings should be made in this file. They will override settings +; in default.ini, but unlike changes made to default.ini, this file won't be +; overwritten on server upgrade. + +[chttpd] +bind_address = any diff --git a/2.0-prod/vm.args b/2.0-prod/vm.args new file mode 100644 index 0000000..0425756 --- /dev/null +++ b/2.0-prod/vm.args @@ -0,0 +1,28 @@ +# 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 +# +# http://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. + +# Ensure that the Erlang VM listens on a known port +-kernel inet_dist_listen_min 9100 +-kernel inet_dist_listen_max 9100 + +# Tell kernel and SASL not to log anything +-kernel error_logger silent +-sasl sasl_error_logger false + +# Use kernel poll functionality if supported by emulator ++K true + +# Start a pool of asynchronous IO threads ++A 16 + +# Comment this line out to enable the interactive Erlang shell on startup ++Bd -noinput -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
