Skip to content

Commit

Permalink
Merge pull request #71 from RaulKite/master
Browse files Browse the repository at this point in the history
Rapid Annotator Installation Guide With docker compose
  • Loading branch information
peteruhrig authored May 18, 2023
2 parents 2ecf747 + d706559 commit 159ff54
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Dockerfile for RapidAnnotator 2.0
## Raúl Sánchez <[email protected]>

FROM ubuntu:18.04

LABEL maintainer="Raúl Sánchez <[email protected]>"
LABEL version="0.1"

# Install dependencies
WORKDIR /var/www/rapidannotator

COPY . /var/www/rapidannotator
COPY docker_files/rapidannotator_httpd.conf /etc/apache2/conf-enabled/rapidannotator.conf

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y apache2 python3-pip libapache2-mod-wsgi-py3 default-libmysqlclient-dev vim net-tools default-mysql-client \
&& pip3 install --upgrade pip && pip3 install numpy && pip3 install -r requirements.txt
RUN cp docker_files/wsgi_template_docker.py wsgi.py \
&& cp docker_files/config_template_docker.py rapidannotator/config.py && mkdir /videos && chmod 777 /videos && sed -i '1 i\Listen 8000' /etc/apache2/ports.conf


VOLUME [ "/videos" ]

EXPOSE 8000

# Docker start apache2 in foreground
CMD ["apachectl", "-D", "FOREGROUND"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Red Hen’s Rapid Annotator provides a platform to users to annotate large chunk
## Installation and User Guide
Please refer the following links to install the Rapid Annotator-2.0 .
* For installation guide refer [here](https://github.com/RedHenLab/RapidAnnotator-2.0/blob/master/docs/installation_guide.md).
* For Docker installation guide refer [here](https://github.com/RedHenLab/RapidAnnotator-2.0/blob/master/docs/installation_guide_docker.md).
* For user guide refer [here](https://github.com/RedHenLab/RapidAnnotator-2.0/blob/master/docs/user_guide.md).

## Contributers from Google Summer of Code
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docker compose for RapidAnnotator
# Raúl Sánchez <[email protected]>

version: '3'

services:
rapidannotator:
build: .
hostname: labyrinth01.inf.um.es
ports:
# external 80 port mapped to internal 8000 port
- "8888:8000"
depends_on:
- db

db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: rapidannotator
MYSQL_USER: rapidannotator
MYSQL_PASSWORD: rapidannotator

34 changes: 34 additions & 0 deletions docker_files/config_template_docker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# All variables should be uppercase
# For sending Mails to the users TESTING should be False in DevlopmentConfig Class
# UPLOAD_FOLDER path must be raw string

class BaseConfig(object):
DEBUG = False
TESTING = False
SQLALCHEMY_ECHO = False
SQLALCHEMY_DATABASE_URI = 'mysql://rapidannotator:rapidannotator@db/rapidannotator'
SECRET_KEY = "sldjfhals13 2hhdwflkjdhfa"
SECURITY_PASSWORD_SALT = "SOME SECURITY SALT like abcdefre"
WTF_CSRF_ENABLED = True
CSRF_ENABLED = True
UPLOAD_FOLDER = r'/videos'
SQLALCHEMY_TRACK_MODIFICATIONS = False

# mail settings
MAIL_SERVER = 'smtp.xxx.xxx'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True

# gmail authentication
MAIL_USERNAME = "[email protected]"
MAIL_PASSWORD = "xxxxxxxx"

# mail accounts
MAIL_DEFAULT_SENDER = "[email protected]"

class DevelopmentConfig(BaseConfig):
DEBUG = True
TESTING = False
SQLALCHEMY_ECHO = True
LOGIN_DISABLED = False
11 changes: 11 additions & 0 deletions docker_files/rapidannotator_httpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<VirtualHost *:8000>

WSGIScriptAlias / /var/www/rapidannotator/wsgi.py

<Directory /var/www/rapidannotator>

Require all granted

</Directory>

</VirtualHost>
9 changes: 9 additions & 0 deletions docker_files/wsgi_template_docker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
''' Delete the lines 2, 3 and 4 if you are not using virtualenv else uncomment it'''
# activate_this = '[Path_to_virtual_environment]/bin/activate_this.py'
# with open(activate_this) as file_:
# exec(file_.read(), dict(__file__=activate_this))

import sys
sys.path.insert(0, '/var/www/rapidannotator')

from rapidannotator import app as application
28 changes: 28 additions & 0 deletions docs/installation_guide_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Rapid Annotator Installation Guide With docker compose

## Clone the repository

```
git clone https://github.com/RedHenLab/RapidAnnotator-2.0.git
```

## Edit config file

Edit the file `docker_files/config_template_docker.py` to configure mail settings and key


## Build and run the container

```
docker-compose build
docker-compose up
```

Connect to http://localhost:8888

> **Warning**
> Use this installation method only for testing pourposes
> It isn't fully secured. No SSL/TLS certificates.
> Database Access user/password in docker-compose.yaml file

0 comments on commit 159ff54

Please sign in to comment.