Giter VIP home page Giter VIP logo

docker-usergrid's Introduction

docker-usergrid

Base docker image to run a Apache usergrid_ BaaS.

Used elements of tutum-docker-tomcat as Tomcat build manifest.

Image tags

    gaborwnuk/usergrid:latest

Usage

First of all - You need Cassandra. If You don't have working instance already, installation using docker is pretty straightforward.

docker run -p 9042:9042 -d --name cass1 poklet/cassandra

Installation from repository only: to create the image gaborwnuk/usergrid, execute the following command on the docker-usergrid folder:

docker build -t gaborwnuk/usergrid .

To run the image and bind to port :

docker run -d -p 8080:8080 --link cass1:cassandra gaborwnuk/usergrid

The first time that you run your container, a new user admin with all privileges will be created in Tomcat with a random password. To get the password, check the logs of the container by running:

docker logs <CONTAINER_ID>

You will see an output like the following:

=> Creating and admin user with a random password in Tomcat ...
=> Done!
=> Creating Apache usergrid_ properties ...
=> Done!
========================================================================
You can now configure to this Tomcat server using:

    admin:rGlsLYtiPce2

In this case, rGlsLYtiPce2 is the password allocated to the admin user for Tomcat admin console.

Important: default username and password for usergrid_ is superuser and VDprvB6bt7ebDW. This can be changed by customising Dockerfile to suit Your needs and add custom usergrid-*.properties file. Without modifications this should not be used on production.

New: You can now set certain properties using ENV vars. I.e. --env SYSADMIN_PASSWORD=mypassword.

docker run -d -p 8080:8080 --env SYSADMIN_PASSWORD=mypassword --link cass1:cassandra gaborwnuk/usergrid

For the full list of ENV vars see usergrid-custom.properties. See the envplate library for more details on syntax and variable replacement rules.

You can now check usergrid_ status with:

curl http://127.0.0.1:8080/status

Probably the most important value here is:

"cassandraAvailable" : true

If Your value is false - usergrid_ won't work as Cassandra instance is required as storage database. Check docker-cassandra.

To fully configure Your Cassandra/usergrid_ , just:

curl http://superuser:[email protected]:8080/system/database/setup

After few moments You should receive following response:

{
  "action" : "cassandra setup",
  "status" : "ok",
  "timestamp" : 1409052433807,
  "duration" : 7442
}

Now You're good to go - create Your account:

curl -X POST  \
     -d 'organization=gwp&username=admin&name=Admin&[email protected]&password=password' \
     http://127.0.0.1:8080/management/organizations

Authenticate and get token:

curl "http://127.0.0.1:8080/management/token?grant_type=password&username=admin&password=password"

You should receive authentication feedback with token used in all following REST requests, ie:

curl -H "Authorization: Bearer YWMtA6C8Ti0bEeSpsz3neosJlAAAAUg2TNNzocqs39RLNbd_V5gr2jaoUacix0E" \
     -H "Content-Type: application/json" \
     -X POST -d '{ "name":"myapp" }' \
     http://127.0.0.1:8080/management/orgs/gwp/apps

And so on.

From now on, if You're interested on how to secure Your usergrid_ instance, refer to https://github.com/apache/incubator-usergrid/tree/master/stack and https://usergrid.incubator.apache.org/docs/.

Customising usergrid_ docker container

If you want to use a preset password instead of a random generated one, you can set the environment variable TOMCAT_PASS to your specific password when running the container:

docker run -d -p 8080:8080 -e TOMCAT_PASS="mypass" gaborwnuk/usergrid

Following environmental variables are available:

  • TOMCAT_PASS (Optional, default: random generated) - Tomcat instance password, use if required. You won't probably need this.

docker-usergrid's People

Contributors

afterthought avatar gaborwnuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-usergrid's Issues

Error while docker-compose up

Hi,

I ran docker-compose up from the root folder and I got the below error message.

Building dependency tree...
Package openjdk-7-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openjdk-7-jdk' has no installation candidate
Service 'usergrid' failed to build: The command '/bin/sh -c apt-get update ; apt-get install -y wget curl pwgen openjdk-7-jdk tomcat7' returned a non-zero code: 100

Kubernetes

I'm trying to use set up cassandra and usergrid with Kubernetes. Why did you remove ability to specify cassandra host and port at run time?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.