| # 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 klaemo@fastmail.fm |
| |
| ENV COUCHDB_VERSION developer-preview-2.0 |
| |
| RUN groupadd -r couchdb && useradd -d /usr/src/couchdb -g couchdb couchdb |
| |
| # download dependencies |
| RUN apt-get update -y \ |
| && apt-get install -y --no-install-recommends build-essential libmozjs185-dev \ |
| libnspr4 libnspr4-0d libnspr4-dev libcurl4-openssl-dev libicu-dev \ |
| openssl curl ca-certificates git pkg-config \ |
| apt-transport-https python wget \ |
| python-sphinx texlive-base texinfo texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra #needed to build the doc |
| |
| RUN wget http://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_18.0-1~debian~jessie_amd64.deb |
| RUN apt-get install -y --no-install-recommends libwxgtk3.0 default-jdk |
| RUN apt-get install -y --no-install-recommends procps |
| |
| RUN dpkg -i esl-erlang_18.0-1~debian~jessie_amd64.deb |
| |
| RUN git clone https://github.com/rebar/rebar /usr/src/rebar \ |
| && (cd /usr/src/rebar ; make && mv rebar /usr/local/bin/) |
| |
| RUN cd /usr/src \ |
| && git clone https://git-wip-us.apache.org/repos/asf/couchdb.git \ |
| && cd couchdb \ |
| && git checkout master |
| |
| RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ |
| && echo 'deb https://deb.nodesource.com/node jessie main' > /etc/apt/sources.list.d/nodesource.list \ |
| && echo 'deb-src https://deb.nodesource.com/node jessie main' >> /etc/apt/sources.list.d/nodesource.list \ |
| && apt-get update -y && apt-get install -y nodejs \ |
| && npm install -g npm && npm install -g grunt-cli |
| |
| RUN apt-get -y install haproxy |
| |
| RUN cd /usr/src/couchdb && ./configure && make |
| |
| # permissions |
| RUN chmod +x /usr/src/couchdb/dev/run && chown -R couchdb:couchdb /usr/src/couchdb |
| |
| USER couchdb |
| |
| # Expose to the outside |
| RUN sed -i'' 's/bind_address = 127.0.0.1/bind_address = 0.0.0.0/' /usr/src/couchdb/rel/overlay/etc/default.ini |
| |
| EXPOSE 5984 |
| WORKDIR /usr/src/couchdb |
| |
| ENTRYPOINT ["/usr/src/couchdb/dev/run"] |