Sign inSign up

fulbito/cassandra

By fulbito

•Updated over 9 years ago

cassandra

Image
0

1.8K

fulbito/cassandra repository overview

⁠Docker based development environment

This README would normally document whatever steps are necessary to get your application up and running.

⁠How do I get set up?
  1. create a common folder fulbito
#!shell
mkdir fulbito && cd fulbito
  1. clone all projects
#!shell
git clone [email protected]:fulbito/fulbito-docker.git
git clone [email protected]:fulbito/fulbito-core.git
git clone [email protected]:fulbito/fulbito-frontend.git
  1. create vagrant virtual machine and log into
#!shell
cd fulbito-docker
vagran up
vagrant ssh
  1. build base images
cd /fulbito/fulbito-docker/fulbito-base
docker build -t fulbito/fulbito-base .

cd /fulbito/fulbito-docker/cassandra-base
docker build -t fulbito/cassandra-base .
  1. build images
#!shell
cd /fulbito/fulbito-docker
docker-compose build
  1. rerun docker-compose build if something was wrong
  2. the same ^^ unitl all is ok
  3. up all images
#!shell
docker-compose up [-d] 

use -d option to run in detached mode

  1. Add 192.168.92.8 fulbito-dev.com to /etc/hosts in your host machine

  2. check services

http://fulbito-dev.com/⁠ -> rest app

fulbito-dev.com:3306 -> mysql

⁠How work

This project is used to recreate the whole development environment used for fulbito, it need few services each one live into a container. The services used are:

  • web -> Web Rest api (Python django rest)
  • db -> Mysql database
  • cassandra -> NO-SQL Cassandra
  • rabbitMQ -> Message queues
  • worker -> app worker message consumer
  • redis -> celery result backend
  • frontend -> Frontend (SPA based on reactjs) (not used)

Each services is a docker container and we use docker-compose to organize this dockerized applications. The main container is web it is the rest application and use db, and cassandra instance to work, db and mongo db are linked to web so when we start the web container db and cassandra are started and linked to web.

Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container >application in a single file, then spin your application up in a single command which does everything that needs to be done >to get it running.

The containers that need persistent data like db or mongodb use a volumes container, volumes container are containers that only exist with the intention of link a host folder where the persistent files are stored into a container. So when the mysqld or mongodb container will destroyed the related data is kept by the host. In our case the folder for persistent data is /volumes

Is not good idea development frontend project into docker frontend container so i recommend not use it. Is better if you use your host machine to do it. See the docker frontend project to starting with.

⁠Some usefully docker-compose commands

remember that docker-compose command runs on /fulbito/fulbito-docker

⁠Omit Frontend container

To omit start frontend container use.

#!shell
docker-compose up [-d] 
⁠Use terminal into container

We can't login to containers by ssh so to use the bin/bash into any container we need start it with bin/bash as service. for instance to run bin/bash in web container we need.

  1. Start web use above command with -d, we need do it to start linked containers to (mysql, mongodb)
  2. Stop web but with end the linked
#!shell
docker-compose stop web 
  1. run bin/bash as service
#!shell
docker-compose run  --service-port web /bin/bash
⁠See logs

to see logs from all running containers use

#!shell
docker-compose logs

for specific

#!shell
docker-compose logs web
⁠Check status for all containers
#!shell
docker-compose ps
⁠Stop all containers
#!shell
docker-compose stop
⁠See environment variables into container
#!shell
docker-compose run web env
⁠remove all containers
#!shell
docker rm $(docker ps -a -q)

Tag summary

Content type

Image

Digest

sha256:92bd199c2…

Size

208.2 MB

Last updated

over 9 years ago

docker pull fulbito/cassandra