Commit 7fe3cec7 authored by c24b's avatar c24b

[DOCKER] M

parent 56aa4eca
...@@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%' SECRET_KEY = '!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = True
MAINTENANCE = False MAINTENANCE = False
ALLOWED_HOSTS = [ 'localhost' ALLOWED_HOSTS = [ 'localhost'
......
``` #!/bin/bash
#!bin/bash
#name:01-setup #name:01-setup
#TODO clone the repo into /srv/gargantext/ and reduce the different steps
#git clone ssh://gitolite@delanoe.org:1979/gargantext /srv/gargantext \
# && cd /srv/gargantext \
# && git fetch origin stable \
# && git checkout stable \
echo "****************SETUP**************************"; echo "****************SETUP**************************";
for dir in "/srv/gargantext_lib" "/srv/gargantext_static" "/srv/gargantext_media"; do for dir in "/srv/gargantext_lib" "/srv/gargantext_static" "/srv/gargantext_media"; do
sudo mkdir -p $dir ; sudo mkdir -p $dir ;
sudo chown gargantua:gargantua $dir ; sudo chown gargantua:gargantua $dir ;
done; done;
sudo wget http://dl.gargantext.org/gargantext_lib.tar.bz2 \ #here gargantext_lib.tar.bz2 inside this directory
&& sudo tar xvjf gargantext_lib.tar.bz2 -o /srv/gargantext_lib \
#sudo wget http://dl.gargantext.org/gargantext_lib.tar.bz2 && \
sudo tar xvjf gargantext_lib.tar.bz2 -o /srv/gargantext_lib \
&& sudo chown -R gargantua:gargantua /srv/gargantext_lib \ && sudo chown -R gargantua:gargantua /srv/gargantext_lib \
&& echo ":::::::::::::::::Done::::::::::::::::::::::::::"; && echo ":::::::::::::::::Done::::::::::::::::::::::::::";
#TODO clone the repo into /srv/gargantext/ and reduce the different steps
#git clone ssh://gitolite@delanoe.org:1979/gargantext /srv/gargantext \
# && cd /srv/gargantext \
# && git fetch origin stable \
# && git checkout stable \
```
#!/bin/bash #!/bin/bash
#configure the base image gargamelle #configure the base image gargamelle
echo '****************BUILD**********************************' #echo '****************BUILD**********************************'
docker build -t gargamelle:latest ./gargamelle sudo docker build -t gargamelle:latest ./gargamelle
#sudo docker build -t gargamelle:latest ./gargamelle
#2 option with this image: #2 option with this image:
# configure the container # configure the container
# run the image with the app in it # run the image with the app in it
...@@ -15,15 +15,15 @@ sudo docker run \ ...@@ -15,15 +15,15 @@ sudo docker run \
-p 8000 \ -p 8000 \
-p 5432 \ -p 5432 \
-it gargamelle:latest \ -it gargamelle:latest \
/bin/bash -c "/srv/gargantext/install/gargamelle/psql_configure.sh" /bin/bash -c "/srv/gargantext/install/gargamelle/psql_configure.sh && /srv/gargantext/install/gargamelle/django_configure.sh && exit;"
sudo docker rm -f `docker ps -a | grep -v CONTAINER | awk '{print $1 }'` sudo docker rm -f `docker ps -a | grep -v CONTAINER | awk '{print $1 }'`
sudo docker run \ #~ sudo docker run \
-v /srv/:/srv/ \ #~ -v /srv/:/srv/ \
-p 8000 \ #~ -p 8000 \
-p 5432 \ #~ -p 5432 \
-it gargamelle:latest \ #~ -it gargamelle:latest \
/bin/bash -c "/srv/gargantext/install/gargamelle/django_configure.sh" #~ /bin/bash -c "/srv/gargantext/install/gargamelle/django_configure.sh; exit;"
sudo docker rm -f `docker ps -a | grep -v CONTAINER awk '{print $1 }'` #sudo docker rm -f `docker ps -a | grep -v CONTAINER awk '{print $1 }'`
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
echo "Starting Postgres" #echo "Starting Postgres"
/usr/sbin/service postgresql start #/usr/sbin/service postgresql start
/bin/su gargantua -c 'source /env_3-5/bin/activate \ /bin/su gargantua -c 'source /env_3-5/bin/activate \
&& ./srv/gargantext/manage.py makemigrations \ && ./srv/gargantext/manage.py makemigrations \
......
...@@ -22,6 +22,7 @@ else ...@@ -22,6 +22,7 @@ else
fi fi
su postgres -c '/usr/lib/postgresql/9.5/bin/initdb -D /srv/gargandata/' su postgres -c '/usr/lib/postgresql/9.5/bin/initdb -D /srv/gargandata/'
#su postgres -c '/usr/lib/postgresql/9.5/bin/pg_ctl -D /srv/gargandata/ -l journal_applicatif start'
su postgres -c '/usr/lib/postgresql/9.5/bin/pg_ctl -D /srv/gargandata/ -l journal_applicatif start' su postgres -c '/usr/lib/postgresql/9.5/bin/pg_ctl -D /srv/gargandata/ -l journal_applicatif start'
...@@ -34,4 +35,4 @@ su postgres -c "psql -c \"CREATE user gargantua WITH PASSWORD 'C8kdcUrAQy66U'\"" ...@@ -34,4 +35,4 @@ su postgres -c "psql -c \"CREATE user gargantua WITH PASSWORD 'C8kdcUrAQy66U'\""
su postgres -c "createdb -O gargantua gargandb" su postgres -c "createdb -O gargantua gargandb"
echo "Postgres configured" echo "Postgres configured"
service postgresql stop #service postgresql stop
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