{"id":17686406,"url":"https://github.com/yep/usergrid-docker","last_synced_at":"2025-05-08T19:36:53.305Z","repository":{"id":29067508,"uuid":"32595412","full_name":"yep/usergrid-docker","owner":"yep","description":"Build and run Usergrid 2.1 using Docker","archived":false,"fork":false,"pushed_at":"2016-02-10T16:31:24.000Z","size":59,"stargazers_count":40,"open_issues_count":5,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T17:54:26.839Z","etag":null,"topics":["cassandra","docker","elasticsearch","usergrid","vagrant"],"latest_commit_sha":null,"homepage":"http://usergrid.apache.org","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-20T16:43:58.000Z","updated_at":"2024-04-02T17:42:03.000Z","dependencies_parsed_at":"2022-08-22T19:10:06.088Z","dependency_job_id":null,"html_url":"https://github.com/yep/usergrid-docker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yep%2Fusergrid-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yep%2Fusergrid-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yep%2Fusergrid-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yep%2Fusergrid-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yep","download_url":"https://codeload.github.com/yep/usergrid-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253135475,"owners_count":21859650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cassandra","docker","elasticsearch","usergrid","vagrant"],"created_at":"2024-10-24T10:44:50.703Z","updated_at":"2025-05-08T19:36:53.217Z","avatar_url":"https://github.com/yep.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Usergrid on Docker\r\n==================\r\n\r\nA collection of containers to run [Usergrid](https://usergrid.apache.org) on [Docker](https://www.docker.com).\r\n\r\nThere are the following containers:\r\n\r\n - Java - Ubuntu base image with Oracle JVM version 8, [github](https://github.com/yep/usergrid-java), [automated build](https://hub.docker.com/r/yep1/usergrid-java), MIT license\r\n - Cassandra - version 2.1, [github](https://github.com/yep/usergrid-cassandra), [automated build](https://hub.docker.com/r/yep1/usergrid-cassandra/)\r\n - Elasticsearch - version 1.7, [github](https://github.com/yep/usergrid-elasticsearch), [automated build](https://hub.docker.com/r/yep1/usergrid-elasticsearch/), MIT license\r\n - Usergrid - version 2.1, [github](https://github.com/yep/usergrid-docker), [automated build](https://hub.docker.com/r/yep1/usergrid)\r\n - Usergrid Admin Portal - version 2.1, [github](https://github.com/yep/usergrid-portal), [automated build](https://hub.docker.com/r/yep1/usergrid-portal)\r\n\r\nTo see how the containers can be started, have a look at the `provision.sh` script from the `provision` directory.\r\n\r\nLocal testing using [Vagrant](http://vagrantup.com) and deployment to [Amazon Web Services (AWS)](http://aws.amazon.com) are supported, see below.\r\n\r\n\r\nRun on Vagrant\r\n---------------\r\n\r\nTo get started quickly, it is recommended to use Vagrant.\r\n\r\nInstall the following dependencies:\r\n\r\n - [Virtualbox](http://virtualbox.org)\r\n - [Vagrant](http://vagrantup.com)\r\n\r\nOn windows, you may additionally have to install `rsync` and `ssh` using something like [mingw](http://www.mingw.org) or [cygwin](http://www.cygwin.com).\r\n\r\nIn the `Vagrantfile`, set the IP for your Vagrant VM. Use an unassigned IP reachable in your local network:\r\n\r\n    ip = YOUR_IP\r\n\r\nThen, in the root directory of the repository run:\r\n\r\n    vagrant up\r\n\r\nThis should automatically download and start an instance of [CoreOS](http://coreos.com).\r\n\r\nUsergrid API should be available on port 8080 and the admin portal at port 80.\r\n\r\nUsergrid status at `YOUR_IP:8080/status` should show for cassandra `\"cassandraAvailable\" : true`, `\"cassandraStatus\" : \"GREEN\"` and for elasticsearch `\"managementAppIndexStatus\" : \"YELLOW\"`.\r\n\r\nIf you make any changes to the configuration, update the files inside the VM and restart the containers with\r\n\r\n    vagrant rsync \u0026\u0026 vagrant provision\r\n\r\nUsing Vagrant, it is simple to start up multiple virtual machines (VMs) simulatenously by changing the `num_instances` parameter in the `Vagrantfile`. You can also adjust the `vb_memory` and `vb_cpu` parameters to change the amount of memory and number of CPUs available to the VM.\r\n\r\n\r\nRun manually\r\n------------\r\n\r\nInstead of using Vagrant, you can use Docker directly. If you are not using Linux on your development machine, it is recommended to install the [Docker Toolbox](https://www.docker.com/products/overview#/docker_toolbox).\r\n\r\nThe examples below use the automated builds from the [Docker Hub](https://hub.docker.com).\r\n\r\nStart Cassandra and Elasticsearch:\r\n\r\n    docker run --detach --name cassandra --volume $(pwd)/cassandra-data:/var/lib/cassandra yep1/usergrid-cassandra\r\n    docker run --detach --name elasticsearch --volume $(pwd)/elasticsearch-data:/data yep1/usergrid-elasticsearch\r\n\r\nStart Usergrid, configuration is done using environment variables (--env). For a list all configuration variables, see below:\r\n\r\n    docker run --detach --name usergrid --env ADMIN_PASS=password --env ORG_NAME=org --env APP_NAME=app --link elasticsearch:elasticsearch --link cassandra:cassandra -p 8080:8080 yep1/usergrid\r\n\r\nStart the Usergrid admin portal, change 192.168.1.34:8080 to match the public reachable IP and port of the Usergrid container\r\n\r\n    docker run --env USERGRID_HOST=192.168.1.34:8080 -p 80:80 yep1/usergrid-portal\r\n\r\n\r\nEnvironment Variables\r\n---------------------\r\n\r\nThe following [environment variables](http://docs.docker.com/userguide/dockerlinks/#environment-variables) are used to access [backing services](http://12factor.net/backing-services) in scripts of the usergrid container. The names of the Cassandra and Elasticsearch containers can not be changed or you also have to change the names of the environment variables below.\r\n\r\n    CASSANDRA_PORT_9160_TCP_ADDR\r\n    CASSANDRA_PORT_9160_TCP_PORT\r\n    ELASTICSEARCH_PORT_9300_TCP_ADDR\r\n    ELASTICSEARCH_PORT_9300_TCP_PORT\r\n\r\nConfiguration variables for the `usergrid` container:\r\n\r\n    ADMIN_USER\r\n    ADMIN_PASS\r\n    ADMIN_MAIL\r\n    ORG_NAME\r\n    APP_NAME\r\n    CASSANDRA_CLUSTER_NAME\r\n    USERGRID_CLUSTER_NAME\r\n    TOMCAT_RAM\r\n\r\nConfiguration variables for the `cassandra` container:\r\n\r\n    CASSANDRA_CLUSTER_NAME\r\n    CASSANDRA_LISTEN_ADDRESS\r\n    CASSANDRA_SEEDS\r\n    CASSANDRA_RPC_ADDRESS\r\n    CASSANDRA_BROADCAST_RPC_ADDRESS\r\n\r\nConfiguration variables for the `portal` container:\r\n\r\n    USERGRID_HOST\r\n\r\n\r\nBuild\r\n-----\r\n\r\nBuild the containers manually instead of using the automated builds.\r\n\r\nGet the submodules first:\r\n\r\n    git clone https://github.com/yep/usergrid-docker.git\r\n    cd usergrid-docker\r\n    git submodule update --init\r\n\r\nThen, build the java base container:\r\n\r\n    cd java \u0026\u0026 build -t usergrid-java .\r\n\r\nThe java container is used by all other containers. By default, automated build of the java container is used. Therefore, in each `Dockerfile` change `FROM yep1/usergrid-java` to `FROM usergrid-java` to use the local java container you just created.\r\n\r\nFinally, build the containers:\r\n\r\n    cd cassandra \u0026\u0026 build -t usergrid-cassandra .\r\n    cd elasticsearch \u0026\u0026 build -t usergrid-elasticsearch .\r\n    cd usergrid \u0026\u0026 build -t usergrid .\r\n    cd portal \u0026\u0026 build -t usergrid-portal .\r\n\r\nStart the containers as shown in section `Usage`, but remove the prefix `yep1/` from the image name to use your local builds.\r\n\r\n\r\nRun on AWS\r\n----------\r\n\r\nDeployment to Amazon Web Services [(AWS)](http://aws.amazon.com) can be done using the `aws-deploy.sh` script from the `provision` directory.\r\n\r\nGetting started:\r\n\r\n - Generate key pair in the aws console or add a locally generated key pair\r\n - Create a user called `usergrid` in IAM, download the credentials and attach the `AmazonSQSFullAccess` policy\r\n - Start the latest stable CoreOS community ami with hvm (hardware virtualization) of size `m3.medium`. At time of writing, latest is `ami-0e300d13` called `CoreOS-stable-607.0.0-hvm`\r\n - Set up an SSH alias called `aws` so you can ssh into the machine by typing `ssh aws` without entering a password\r\n - Run `aws-provision.sh`\r\n\r\nApple push notification (apns) setup note:\r\n\r\nWhen generating the `notifier` in usergrid, a .p12 certificate is required.\r\n\r\nTo create this .p12 certificate, you have to select BOTH the private key (of type `private key`) and the public key signed by Apple (of type `certificate`) in the Apple keychain OSX app at the same time and then export both of them into one .p12 file.\r\n\r\n\r\nUsergrid Documentation\r\n----------------------\r\n\r\n * [Usergrid Backend as a Service (BaaS) Documentation](http://apigee.com/docs/api-baas/content/build-apps-home)\r\n * [Usergrid REST Endpoints](http://apigee.com/docs/app-services/content/rest-endpoints)\r\n\r\n\r\nPostman\r\n-------\r\n\r\nFor debugging of REST commands, you can use [Postman](http://getpostman.com).\r\n\r\nImport the postman collection `usergrid.json.postman_collection` and environment `usergrid.json.postman_environment` from the `postman` directory.\r\n\r\nTo use `postman`, request an API token using one of the provided commands and set the `token` parameter in the `environment` of `postman` accordingly. Also set the `ip` parameter in the environment.\r\n\r\n\r\nUsage\r\n-----\r\n\r\nSome useful `vagrant` commands:\r\n\r\n * `vagrant up` - start VM\r\n * `vagrant ssh` - ssh into VM\r\n * `vagrant halt` - stop VM\r\n * `vagrant destroy` - remove VM, run `vagrant up` to start from scratch\r\n * `vagrant rsync` - update shared folder using rsync\r\n * `vagrant provision` - run the provion script from the Vagrantfile\r\n * `vagrant box update` - update CoreOS base box\r\n\r\nSome useful `docker` commands, run these from inside of the VM:\r\n\r\n * `docker build -t usergrid .` - build the dockerfile in the current directory and tag the container with `usergrid`\r\n * `docker run -d --name usergrid --link elasticsearch:elasticsearch --link cassandra:cassandra -t usergrid` - run the container which was built with the above command in the background (detached, -d), expose the usergrid http api port (8080, -p) and make the ports exposed by `elasticsearch` and `cassandra` available by linking the containers together\r\n * `docker ps` - show container ids of running containers\r\n * `docker logs -f usergrid` - follow the log of the container with tag `usergrid`\r\n * `docker stop usergrid` - stop running container with tag `usergrid`\r\n * `docker run -i -t usergrid /bin/bash` - start an interactive bash shell in the container with tag `usergrid`\r\n * `docker ps -q|docker stop; docker images -q|xargs docker rmi -f` - stop and delete ALL old docker images to free up disk space\r\n\r\nSome useful usergrid command line `ugc` commands:\r\n\r\nInstall `ugc` with `gem install ugc`. Documentation is [here](https://github.com/apache/incubator-usergrid/tree/master/ugc). For more examples, see the [ugc examples](https://github.com/apache/incubator-usergrid/tree/master/ugc#examples).\r\n\r\n * `ugc profile org` - create profile with name `org`. subsequent commands are applied to this profile.\r\n * `ugc target url http://$IP:8080/org/app` - use host at $IP, organization called `org` and app called `app`\r\n * `ugc login --admin $USERNAME@example.com` - log in as one of the admins users `admin` or `orgadmin`. password is the same as the username.\r\n * `ugc login $USERNAME@example.com` - log in as regular user. there is a default user called `orguser`. password is same as username.\r\n * `ugc list collections` - list collections. think of it as tables in a relational database. you can list other things as well.\r\n\r\nSome useful Virtualbox commands:\r\n\r\n * `VBoxManage hostonlyif remove vboxnet0` - manually delete a hostonly network if it was not properly removed by Virtualbox\r\n\r\nSome useful OSX commands:\r\n\r\n * `ifconfig bridge0 delete` - manually delete a bridge if it was not properly removed by Virtualbox\r\n\r\n\r\nLicense\r\n-------\r\n\r\n    Copyright 2014-2016 Jahn Bertsch\r\n    Copyright 2015 TOMORROW FOCUS News+ GmbH\r\n\r\n    Licensed under the Apache License, Version 2.0 (the \"License\");\r\n    you may not use this file except in compliance with the License.\r\n    You may obtain a copy of the License at\r\n\r\n    http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n    Unless required by applicable law or agreed to in writing, software\r\n    distributed under the License is distributed on an \"AS IS\" BASIS,\r\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyep%2Fusergrid-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyep%2Fusergrid-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyep%2Fusergrid-docker/lists"}