Giter VIP home page Giter VIP logo

docker-spdo's Introduction

docker-spdo

Docker spdo image source. This is based on ubuntu:12.04 image. SPDO is a system for documents protocol control, used in city legislative chambers on Brazil. This is one of the Interlegis free software products.

After installing docker you could add your user to the docker group.

$ sudo gpasswd -a $USER docker

Image

You can pull a ready to use image from Docker (https://index.docker.io/u/ramiroluz/) running:

$ docker pull ramiroluz/spdo

Or build this repository:

$ git clone https://github.com/ramiroluz/docker-spdo.git
$ cd docker-spdo/
$ docker build -t ramiroluz/spdo .

Change ramiroluz/spdo to your Docker index username.

Container

This image uses volumes and environment variables to control the mysql server configuration, created by @wiliansouza. (https://github.com/wiliansouza/docker-mysql.git).

Volumes:

  • /etc/mysql/conf.d: Change server configurations using it.
  • /var/lib/mysql: Data goes here.
  • /var/log/mysql: Access log from the container using it.

You pass with -v docker option. Don't forget to use absolute path here.

Environment variable:

  • MYSQL_ROOT_PASSWORD: Root password.
  • MYSQL_DATABASE: Database name.
  • MYSQL_USER: If MYSQL_DATABASE is specified create a user.
  • MYSQL_PASSWORD: Password for MYSQL_USER.
  • MYSQL_CHARACTER_SET: Character set for MYSQL_DATABASE.
  • MYSQL_COLLATE: Collate for MYSQL_DATABASE.
  • GRANT_HOSTNAME: Hostname used on GRANT for MYSQL_DATABASE.

You pass with -e docker option.

For example, you can create the directories like this:

$ export VOLUMES=$HOME/.containers/spdo/volumes/mysql/
$ mkdir -p $VOLUMES{'log','lib','conf.d'}

The standard mysql configuration only accept local conections. The containers run as separeted hosts, so it is required to change the mysql configuration to accept conections from other hosts. It is possible to use the following code to download the configuration to the correct prepared directory.

$ wget https://raw.githubusercontent.com/ramiroluz/docker-spdo/master/bind.cnf -O $VOLUMES/conf.d/bind.cnf

Then, run the mysql server as follows:

$ docker run --name mysql_1 -p 3306:3306 -d \
  -v $VOLUMES/log:/var/log/mysql \
  -v $VOLUMES/lib:/var/lib/mysql \
  -v $VOLUMES/conf.d:/etc/mysql/conf.d \
  -e MYSQL_ROOT_PASSWORD=interlegis \
  -e MYSQL_DATABASE=spdo -e MYSQL_USER=admin \
  -e MYSQL_PASSWORD=mypassword -t wiliamsouza/docker-mysql

Usage, ATTENTION, do not use it in production, you must change passwords first:

$ docker run --name spdo -d -p 8380:8380 \
  --link mysql_1:mysql_1 -t ramiroluz/spdo \
  /usr/local/bin/startup

The command above will start a container and return its ID.

To get a shell access:

$ docker run --name spdo -i -p 8380:8380 \
  --link mysql_1:mysql_1 -t ramiroluz/spdo \
  /bin/bash

The command above will start a container give you a shell. Don't forget to start the service running the startup & script.

After that the system should be available at http://localhost:8380

docker-spdo's People

Contributors

ramiroluz avatar

Stargazers

Wiliam Souza avatar

Watchers

 avatar James Cloos avatar

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.