Coder Social home page Coder Social logo

brat_httpd's Introduction

This is a repository to run brat using a docker image based on httpd:2.4. Using this repository, you can:

  • run multiple brat sites on a single server
  • easily create accounts of annotators for each site

How to use

  1. Clone this repository.

  2. Arrange txt files, ann files, annotation.conf, and visual.conf in data directory.

Set up brat on a local environment

  1. Install and start docker.

  2. Run the brat container. If there is not the docker image yet, it is built at this moment. In this process, account information on docker-compose.yml is used.

docker-compose up -d
  1. To enable brat app to modify ann files, change permission of data directory in the container. This directory is mounted from the host machine by docker compose.
docker exec brat bash -c "chgrp -R www-data brat/data && chmod -R g+rwx brat/data"
  1. Access http://localhost/brat.

Set up brat on a cloud service such as Amazon EC2

  1. Install and start docker.
bash install_docker.sh
  1. Modify username, password, and email on docker-compose.yml. They will be used for the master account that is available on every site.

  2. (Optional) To add accounts, add users.json as below in config directory. This setting creates an account of "user_1" and "password_1" for http://<ip address>/brat.

{
  "": {
    "user_1": "password_1"
  }
}
  1. Run the brat container.
sudo docker compose up -d
  1. To enable brat app to modify ann files, change permission of data directory in the container. This directory is mounted from the host machine by docker compose.
sudo docker exec brat bash -c "chgrp -R www-data brat/data && chmod -R g+rwx brat/data"
  1. Access http://<ip address>/brat.

To run additional sites

You can run additional brat sites (applications) on a single server by below steps. An additional site will have the URL http://<ip address>/brat-<suffix>. The suffix can be any string.

  1. Add lines as below on Dockerfile providing suffixes of the sites.
RUN sh ./add_site.sh ${suffix}
  1. (Optional) To add accounts, add key-value pairs as below on config/users.json.
  "<suffix>": {
    "user_2": "password_2"
  }
  1. Duplicate data directory with the name of data-<suffix>. Arrange txt files, ann files, annotation.conf, and visual.conf in the new directory.

  2. Add items to the list of volumes on docker-compose.yml.

- type: bind
  source: ./data-<suffix>
  target: /usr/local/apache2/htdocs/brat-<suffix>/data
  1. Build the image and container again.
sudo docker compose up -d --build
  1. Enable each brat app to modify ann files in each directory.
sudo docker exec brat bash -c "chgrp -R www-data brat-${suffix}/data && chmod -R g+rwx brat-${suffix}/data"

Other Docker operations

Check if containers are running

docker ps

Enter the running brat container

docker exec -it brat bash

Stop the brat container

docker stop brat

Brat tips

To speed up by skipping insignificant operations, change the setting. Hover on the top-right logo, proceed to Options, and change Annotation mode to "Normal".

brat_httpd's People

Contributors

yusuke196 avatar

Watchers

 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.