forked from damnOblivious/rapidannotator
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from RaulKite/master
Rapid Annotator Installation Guide With docker compose
- Loading branch information
Showing
7 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||