My Dockerfile and Docker-compose.yml are created based on arungupta/couchbase
Last active
December 4, 2017 04:15
-
-
Save usk81/74321e479e483c1d30e85c4b39fd7539 to your computer and use it in GitHub Desktop.
Docker compose for Couchbase community edition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x | |
set -m | |
/entrypoint.sh couchbase-server & | |
sleep 15 | |
# Setup index and memory quota | |
curl -v -X POST http://127.0.0.1:8091/pools/default -d memoryQuota=512 -d indexMemoryQuota=512 | |
# Setup services | |
curl -v http://127.0.0.1:8091/node/controller/setupServices -d services=kv%2Cn1ql%2Cindex | |
# Setup credentials | |
curl -v http://127.0.0.1:8091/settings/web -d port=8091 -d username=Administrator -d password=password | |
# Setup Memory Optimized Indexes | |
curl -i -u Administrator:password -X POST http://127.0.0.1:8091/settings/indexes -d 'storageMode=forestdb' | |
# Load travel-sample bucket | |
# curl -v -u Administrator:password -X POST http://127.0.0.1:8091/sampleBuckets/install -d '["travel-sample"]' | |
echo "Type: $TYPE" | |
if [ "$TYPE" = "WORKER" ]; then | |
echo "Sleeping ..." | |
sleep 15 | |
#IP=`hostname -s` | |
IP=`hostname -I | cut -d ' ' -f1` | |
echo "IP: " $IP | |
echo "Auto Rebalance: $AUTO_REBALANCE" | |
if [ "$AUTO_REBALANCE" = "true" ]; then | |
couchbase-cli rebalance --cluster=$COUCHBASE_MASTER:8091 --user=Administrator --password=password --server-add=$IP --server-add-username=Administrator --server-add-password=password | |
else | |
couchbase-cli server-add --cluster=$COUCHBASE_MASTER:8091 --user=Administrator --password=password --server-add=$IP --server-add-username=Administrator --server-add-password=password | |
fi; | |
fi; | |
fg 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
db: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
deploy: | |
replicas: 1 | |
volumes: | |
- ./export/var/couchbase/node1:/opt/couchbase/var | |
ports: | |
- 8091:8091 | |
- 8092:8092 | |
- 8093:8093 | |
- 8094:8094 | |
- 11210:11210 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM couchbase:community | |
COPY configure-node.sh /opt/couchbase | |
#HEALTHCHECK --interval=5s --timeout=3s CMD curl --fail http://localhost:8091/pools || exit 1 | |
CMD ["/opt/couchbase/configure-node.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment