Creating pure BB-CouchDB image.
This commit is contained in:
parent
e7cb5c48cd
commit
5f1019d9fd
|
@ -0,0 +1,31 @@
|
||||||
|
FROM couchdb:3.2.1
|
||||||
|
|
||||||
|
ENV COUCHDB_USER admin
|
||||||
|
ENV COUCHDB_PASSWORD admin
|
||||||
|
EXPOSE 5984
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y software-properties-common wget unzip curl && \
|
||||||
|
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main' && \
|
||||||
|
apt-get update && apt-get install -y openjdk-8-jdk
|
||||||
|
|
||||||
|
# setup clouseau
|
||||||
|
WORKDIR /
|
||||||
|
RUN wget https://github.com/cloudant-labs/clouseau/releases/download/2.21.0/clouseau-2.21.0-dist.zip && \
|
||||||
|
unzip clouseau-2.21.0-dist.zip && \
|
||||||
|
mv clouseau-2.21.0 /opt/clouseau && \
|
||||||
|
rm clouseau-2.21.0-dist.zip
|
||||||
|
|
||||||
|
WORKDIR /opt/clouseau
|
||||||
|
RUN mkdir ./bin
|
||||||
|
ADD clouseau/clouseau ./bin/
|
||||||
|
ADD clouseau/log4j.properties clouseau/clouseau.ini ./
|
||||||
|
RUN chmod +x ./bin/clouseau
|
||||||
|
|
||||||
|
# setup CouchDB
|
||||||
|
WORKDIR /opt/couchdb
|
||||||
|
ADD couch/vm.args couch/local.ini ./etc/
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
ADD runner.sh ./bbcouch-runner.sh
|
||||||
|
RUN chmod +x ./bbcouch-runner.sh
|
||||||
|
ENTRYPOINT ["./bbcouch-runner.sh"]
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
/usr/bin/java -server \
|
||||||
|
-Xmx2G \
|
||||||
|
-Dsun.net.inetaddr.ttl=30 \
|
||||||
|
-Dsun.net.inetaddr.negative.ttl=30 \
|
||||||
|
-Dlog4j.configuration=file:/opt/clouseau/log4j.properties \
|
||||||
|
-XX:OnOutOfMemoryError="kill -9 %p" \
|
||||||
|
-XX:+UseConcMarkSweepGC \
|
||||||
|
-XX:+CMSParallelRemarkEnabled \
|
||||||
|
-classpath '/opt/clouseau/*' \
|
||||||
|
com.cloudant.clouseau.Main \
|
||||||
|
/opt/clouseau/clouseau.ini
|
|
@ -0,0 +1,13 @@
|
||||||
|
[clouseau]
|
||||||
|
|
||||||
|
; the name of the Erlang node created by the service, leave this unchanged
|
||||||
|
name=clouseau@127.0.0.1
|
||||||
|
|
||||||
|
; set this to the same distributed Erlang cookie used by the CouchDB nodes
|
||||||
|
cookie=monster
|
||||||
|
|
||||||
|
; the path where you would like to store the search index files
|
||||||
|
dir=DATA_DIR/search
|
||||||
|
|
||||||
|
; the number of search indexes that can be open simultaneously
|
||||||
|
max_indexes_open=500
|
|
@ -0,0 +1,4 @@
|
||||||
|
log4j.rootLogger=debug, CONSOLE
|
||||||
|
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
|
||||||
|
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %c [%p] %m%n
|
|
@ -0,0 +1,5 @@
|
||||||
|
; CouchDB Configuration Settings
|
||||||
|
|
||||||
|
[couchdb]
|
||||||
|
database_dir = DATA_DIR/couch/dbs
|
||||||
|
view_index_dir = DATA_DIR/couch/views
|
|
@ -0,0 +1,32 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# erlang cookie for clouseau security
|
||||||
|
-name couchdb@127.0.0.1
|
||||||
|
-setcookie monster
|
||||||
|
|
||||||
|
# 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
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/docker-entrypoint.sh /opt/couchdb/bin/couchdb &
|
||||||
|
sleep 10
|
||||||
|
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@localhost:5984/_users
|
||||||
|
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@localhost:5984/_replicator
|
||||||
|
sleep infinity
|
Loading…
Reference in New Issue