Commit 49631d60 authored by delanoe's avatar delanoe

[ADMIN] Files for install, Docker is almost ok, need some tests.

parent b04328e2
from gargantext.util.http import APIView, APIException, JsonHttpResponse
from gargantext.util.http import APIView, APIException, JsonHttpResponse, requires_auth
#from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from gargantext.util.db import session
......@@ -10,6 +10,7 @@ from graphExplorer.functions import get_cooc
class Graph(APIView):
#authentication_classes = (SessionAuthentication, BasicAuthentication)
#@requires_auth
def get(self, request, project_id, corpus_id):
'''
Graph.get :: Get graph data as REST api.
......
FROM debian:stretch
#FROM gargantext
MAINTAINER ISCPIF <alexandre.delanoe@iscpif.fr>
#FROM debian:stretch
FROM gargantext
#MAINTAINER ISCPIF <alexandre.delanoe@iscpif.fr>
#
## Install docker.io
## Install sudo
## wget http://dl.gargantext.
## cd /srv/gargantext/install
## sudo docker build -t gargantext .
#
RUN apt-get update && \
apt-get install -y aptitude \
apt-utils ca-certificates locales \
sudo gcc wget git postgresql-9.5 vim
# docker run -i -t gargantext /bin/bash
# Configure timezone and locale
USER root
RUN echo "Europe/Paris" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata && \
sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
echo 'LANG="fr_FR.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=fr_FR.UTF-8
RUN apt-get update \
&& apt-get install -y postgresql-server-dev-9.5 \
libpq-dev libxml2 libxml2-dev xml-core libgfortran-5-dev
# CREATE USER and adding it to sudo
RUN adduser --disabled-password --gecos "" gargantua
RUN apt-get install -y sudo && adduser gargantua sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# RUN apt-get update && \
# apt-get install -y \
# apt-utils ca-certificates locales \
# sudo aptitude gcc wget git postgresql-9.5 vim
#
# ## Configure timezone and locale
# RUN echo "Europe/Paris" > /etc/timezone && \
# dpkg-reconfigure -f noninteractive tzdata && \
# sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
# sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
# echo 'LANG="fr_FR.UTF-8"' > /etc/default/locale && \
# dpkg-reconfigure --frontend=noninteractive locales && \
# update-locale LANG=fr_FR.UTF-8
#
#
# RUN apt-get update \
# && apt-get install -y postgresql-server-dev-9.5 \
# libpq-dev libxml2 libxml2-dev xml-core libgfortran-5-dev
#
# # PROD VERSION OF GARGANTEXt
# # RUN apt-get install uwsgi nginx
#
#
# ## CREATE USER and adding it to sudo
# ## TODO ask user for password
# RUN adduser --disabled-password --gecos "" gargantua
# RUN apt-get install -y sudo && adduser gargantua sudo \
# && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
#
# # Python dependencies
# # (installing Debian version before pip to get dependencies)
# # TODO: update it with requirements.txt
# RUN apt-get update && apt-get install -y \
# virtualenv python3-virtualenv \
# python3.4 python3.4-dev \
# python3.5 python3.5-dev \
# python3-six python3-numpy
#
# # Installing pip version of python libs
WORKDIR /home/gargantua
RUN wget http://dl.delanoe.org/debian.txt \
&& apt-get update && dpkg --set-selections < debian.txt \
&& apt-get dselect-upgrade \
&& /bin/bash -c 'source /home/gargantua/env_3-5/bin/activate' \
&& /bin/bash -c \
'/home/gargantua/env_3-5/bin/pip install -r \
/home/gargantua/requirements.txt'
#RUN apt-get update && apt-get install -y \
# virtualenv python3-virtualenv \
# python3.4 python3.4-dev \
# python3.5 python3.5-dev \
# && wget http://dl.delanoe.org/requirements.txt \
# FIXME : pip install -r all requirements does not work, need to split the list
#RUN wget http://dl.delanoe.org/requirements.txt \
# && /usr/bin/virtualenv --py=/usr/bin/python3.5 env_3-5 \
# && /bin/bash -c 'source env_3-5/bin/activate' \
# && /bin/bash -c 'env_3-5/bin/pip install git+https://github.com/zzzeek/sqlalchemy.git@rel_1_1' \
# && /bin/bash -c 'env_3-5/bin/pip install -r requirements.txt'
#
#
# chown gargantua
#
#
## CONFIGURE POSTGRESQL
#
......@@ -65,26 +72,17 @@ RUN wget http://dl.delanoe.org/debian.txt \
#VOLUME ["/home/gargantua","/data/gargantext"]
## INSTALL MAIN DEPENDENCIES
#
#USER gargantua
#WORKDIR /home/gargantua
#RUN /usr/bin/virtualenv --py=/usr/bin/python3.4 env_3-4
#RUN wget http://dl.delanoe.org/requirements.txt &&\
# /usr/bin/virtualenv --py=/usr/bin/python3.5 env_3-5 &&\
# source env_3-5/bin/activate &&\
# pip install -R requirements.txt
#
#WORKDIR /srv
#RUN mkdir -p gargantext
# configure postgres here
# OK
#USER postgres
#RUN /etc/init.d/postgresql start &&\
# psql -c "CREATE user gargantua WITH PASSWORD 'C8kdcUrAQy66U'" &&\
# createdb -O gargantua gargandb
USER postgres
RUN /etc/init.d/postgresql start &&\
psql -c "CREATE user gargantua WITH PASSWORD 'C8kdcUrAQy66U'" &&\
createdb -O gargantua gargandb
# GET CONFIG FILES
......@@ -93,8 +91,6 @@ RUN wget http://dl.delanoe.org/debian.txt \
#RUN cd /srv/ && git clone https://gogs.iscpif.fr/gargantext.git
# script pour peupler la base
# mount /srv
......@@ -113,6 +109,3 @@ RUN wget http://dl.delanoe.org/debian.txt \
# ENTRYPOINT /etc/init.d/postgresql start
......@@ -21,10 +21,10 @@ python-dateutil==2.4.2
pytz==2015.7 # timezones
PyYAML==3.11
RandomWords==0.1.12
six==1.10.0
SQLAlchemy==1.1.0b1.dev0
ujson==1.35
umalqurra==0.2 # arabic calendars (?? why use ??)
wheel==0.29.0
pandas==0.18.0
networkx==1.11
six==1.10.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment