From 9a871cee5d6836b82cc906ad74bc6731bb8e72f7 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 15 Nov 2017 17:11:26 +0530 Subject: Move Dockerfile to dedicated directory --- docker/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docker/Dockerfile (limited to 'docker') diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..cc0fd30 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:16.04 + +MAINTAINER FOSSEE + +# Update Packages and Install Python & net-tools +RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y + +RUN apt-get install -y software-properties-common && \ +echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ +add-apt-repository -y ppa:webupd8team/java && \ +apt-get update && \ +apt-get install -y oracle-java8-installer && \ +apt-get install -y python net-tools scilab build-essential python3-numpy python3-scipy ipython3 ipython3-notebook python3-pandas python3-nose -- cgit From 0713c60a5ad4b71d4a2050d13cf30afaf37d935b Mon Sep 17 00:00:00 2001 From: rohmhatre Date: Sun, 26 Nov 2017 00:25:02 +0530 Subject: Added docker compose configuration --- docker/Dockerfile | 13 ------- docker/Dockerfile_codeserver | 19 ++++++++++ docker/Dockerfile_django | 23 ++++++++++++ docker/Files/000-default.conf | 18 ++++++++++ docker/Files/Docker-script.sh | 5 +++ docker/Files/Start-codeserver.sh | 7 ++++ docker/Files/requirements-codeserver.txt | 6 ++++ docker/Files/requirements-common.txt | 9 +++++ docker/Files/requirements-py2.txt | 2 ++ docker/Files/requirements-py3.txt | 2 ++ docker/Makefile | 61 ++++++++++++++++++++++++++++++++ docker/README.md | 30 ++++++++++++++++ docker/docker-compose.yml | 41 +++++++++++++++++++++ 13 files changed, 223 insertions(+), 13 deletions(-) delete mode 100644 docker/Dockerfile create mode 100644 docker/Dockerfile_codeserver create mode 100644 docker/Dockerfile_django create mode 100644 docker/Files/000-default.conf create mode 100644 docker/Files/Docker-script.sh create mode 100644 docker/Files/Start-codeserver.sh create mode 100644 docker/Files/requirements-codeserver.txt create mode 100644 docker/Files/requirements-common.txt create mode 100644 docker/Files/requirements-py2.txt create mode 100644 docker/Files/requirements-py3.txt create mode 100644 docker/Makefile create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml (limited to 'docker') diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index cc0fd30..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM ubuntu:16.04 - -MAINTAINER FOSSEE - -# Update Packages and Install Python & net-tools -RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y - -RUN apt-get install -y software-properties-common && \ -echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ -add-apt-repository -y ppa:webupd8team/java && \ -apt-get update && \ -apt-get install -y oracle-java8-installer && \ -apt-get install -y python net-tools scilab build-essential python3-numpy python3-scipy ipython3 ipython3-notebook python3-pandas python3-nose diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver new file mode 100644 index 0000000..1bc93c2 --- /dev/null +++ b/docker/Dockerfile_codeserver @@ -0,0 +1,19 @@ +FROM ubuntu:16.04 + +MAINTAINER FOSSEE + +RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y + +VOLUME /Sites/online_test + +ADD Files/requirements-* /tmp/ + +RUN pip3 install -r /tmp/requirements-codeserver.txt && mkdir -p /Sites/online_test/yaksh_data/output /Sites/online_test/yaksh_data/data + +WORKDIR /Sites/online_test/yaksh_data + +ADD Files/Start-codeserver.sh /Sites + +EXPOSE 53579 + +CMD [ "/bin/bash" , "/Sites/Start-codeserver.sh" ] diff --git a/docker/Dockerfile_django b/docker/Dockerfile_django new file mode 100644 index 0000000..6b87afb --- /dev/null +++ b/docker/Dockerfile_django @@ -0,0 +1,23 @@ +FROM ubuntu:16.04 + +MAINTAINER FOSSEE + +RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y + +RUN apt-get install apache2 vim libapache2-mod-wsgi-py3 python3-django -y && mkdir -p /Sites/online_test + +VOLUME /Sites/online_test + +ADD Files/requirements-* /tmp/ + +RUN cd /Sites/online_test && pip3 install -r /tmp/requirements-py3.txt + +ADD Files/000-default.conf /etc/apache2/sites-enabled/ + +ADD Files/Docker-script.sh /Sites/Docker-script.sh + +EXPOSE 80 + +WORKDIR /Sites/online_test + +CMD [ "/bin/bash" , "/Sites/Docker-script.sh" ] diff --git a/docker/Files/000-default.conf b/docker/Files/000-default.conf new file mode 100644 index 0000000..6bcb382 --- /dev/null +++ b/docker/Files/000-default.conf @@ -0,0 +1,18 @@ + + ServerName localhost + ServerAdmin webmaster@localhost + DocumentRoot /Sites/online_test + WSGIDaemonProcess yaksh threads=5 python-path=/usr/local/lib/python3.5/dist-packages home=/Sites/online_test + WSGIScriptAlias / /Sites/online_test/online_test/wsgi.py + WSGIProcessGroup yaksh + Alias /static/ /Sites/online_test/yaksh/static/ + + WSGIProcessGroup yaksh + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + Require all granted + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/docker/Files/Docker-script.sh b/docker/Files/Docker-script.sh new file mode 100644 index 0000000..752a638 --- /dev/null +++ b/docker/Files/Docker-script.sh @@ -0,0 +1,5 @@ +#!/bin/bash +chown -R www-data /Sites/online_test +chmod -R 644 /Sites/online_test +chmod -R +X /Sites +/usr/sbin/apache2ctl -D FOREGROUND diff --git a/docker/Files/Start-codeserver.sh b/docker/Files/Start-codeserver.sh new file mode 100644 index 0000000..8b6ea96 --- /dev/null +++ b/docker/Files/Start-codeserver.sh @@ -0,0 +1,7 @@ +#!/bin/bash +chown -R nobody /Sites/online_test +chmod -R a+rwX yaksh_data/output +chmod -R a+rX yaksh_data/data yaksh_data/yaksh +chmod -R o-w yaksh_data/data yaksh +chmod -R +X /Sites/online_test/ +/usr/bin/sudo -su nobody python3 -m yaksh.code_server diff --git a/docker/Files/requirements-codeserver.txt b/docker/Files/requirements-codeserver.txt new file mode 100644 index 0000000..e9585fa --- /dev/null +++ b/docker/Files/requirements-codeserver.txt @@ -0,0 +1,6 @@ +pytest +python-decouple +six +requests +tornado +psutil diff --git a/docker/Files/requirements-common.txt b/docker/Files/requirements-common.txt new file mode 100644 index 0000000..b4d2e5b --- /dev/null +++ b/docker/Files/requirements-common.txt @@ -0,0 +1,9 @@ +-r requirements-codeserver.txt +invoke==0.21.0 +django==1.9.5 +django-taggit==0.18.1 +pytz==2016.4 +python-social-auth==0.2.19 +selenium==2.53.6 +coverage +ruamel.yaml==0.15.23 \ No newline at end of file diff --git a/docker/Files/requirements-py2.txt b/docker/Files/requirements-py2.txt new file mode 100644 index 0000000..38777a1 --- /dev/null +++ b/docker/Files/requirements-py2.txt @@ -0,0 +1,2 @@ +-r requirements-common.txt +mysql-python==1.2.5 diff --git a/docker/Files/requirements-py3.txt b/docker/Files/requirements-py3.txt new file mode 100644 index 0000000..3d13335 --- /dev/null +++ b/docker/Files/requirements-py3.txt @@ -0,0 +1,2 @@ +-r requirements-common.txt +mysqlclient==1.3.9 diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 0000000..9119601 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,61 @@ +help: + @echo "Docker Compose Help for Deploying Yaksh interface" + @echo "-----------------------\n" + @echo "Clone yaksh online interface from github :" + @echo " make clone" + @echo "" + @echo "Build docker images:" + @echo " make build" + @echo "" + @echo "To run containers:" + @echo " make start" + @echo "" + @echo "You need to create super a user to work with yaksh:" + @echo " make createsuperuser" + @echo "" + @echo "Now Your interface is ready. You can access it using browser just go to http://localhost:8000" + @echo "" + @echo "Really, really start over:" + @echo " make clean" + @echo "" + @echo "other utilities:restart,tail,status" + +begin: migrate fixtures start + +clone: + @/bin/bash clone-yaksh.sh + +start: + @docker-compose up -d + +stop: + @docker-compose stop + +status: + @docker-compose ps + +restart: stop start + +clean: stop + @docker-compose rm --force + +build: + @docker-compose build --no-cache + @docker pull mariadb:10.2 + +createsuperuser: migrate superuser + +migrate: + @docker exec -it yaksh_django python3 manage.py makemigrations + @docker exec -it yaksh_django python3 manage.py migrate + +superuser: + @docker exec -it yaksh_django python3 manage.py createsuperuser + @docker exec -it yaksh_django python3 manage.py add_group + @docker exec -it yaksh_django python3 manage.py collectstatic + @echo "You can access it using browser, just go to http://localhost:8000" + +tail: + @docker-compose logs -f + +.PHONY: start stop status restart clean build migrate tail clone superuser createsuperuser diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..34e30da --- /dev/null +++ b/docker/README.md @@ -0,0 +1,30 @@ +#### Pre-Requisites + + 1. Install Docker https://docs.docker.com/engine/installation/ + 2. Install Docker Compose https://docs.docker.com/compose/install/#install-compose + 3. install git + + +#### Help for deploying Yaksh interface. + + - To get help while deployment + $ make help + + - Clone yaksh form github: + $ make clone + + - Build docker images: + $ make build + + - To run containers: + $ make start + + - You need to create super a user to work with yaksh: + $ make createsuperuser + + - Now Your interface is ready. You can access it using browser just go to http://localhost:8000 + + - Clean your docker containers: + $ make clean + + - other utilities like restart, tail, status diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..747cbda --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,41 @@ +version: '2' +services: + yaksh-django: + build: + context: . + dockerfile: Dockerfile_django + image: yaksh.django + container_name: yaksh_django + volumes: + - ../.:/Sites/online_test + depends_on: + - yaksh-db + - yaksh-codeserver + links: + - yaksh-db + - yaksh-codeserver + ports: + - 8000:80 + restart: always + + + yaksh-codeserver: + build: + context: . + dockerfile: Dockerfile_codeserver + image: yaksh.codeserver + container_name: yaksh_codeserver + volumes: + - ../yaksh_data:/Sites/online_test/yaksh_data + restart: always + + + yaksh-db: + image: mariadb:10.2 + container_name: yaksh_db + volumes: + - ./mysql:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: yaksh + restart: always -- cgit From 268371d956dbe5cf349f1f6d8b3e4594a5c8c479 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 11 Dec 2017 12:14:33 +0530 Subject: Multiple changes: - Remove requirement files placed in docker/Files - Modify tasks to dynamically copy requirement files into docker directory - Add java installation to Docker files --- docker/Dockerfile_codeserver | 8 +++++++- docker/Files/requirements-codeserver.txt | 6 ------ docker/Files/requirements-common.txt | 9 --------- docker/Files/requirements-py2.txt | 2 -- docker/Files/requirements-py3.txt | 2 -- 5 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 docker/Files/requirements-codeserver.txt delete mode 100644 docker/Files/requirements-common.txt delete mode 100644 docker/Files/requirements-py2.txt delete mode 100644 docker/Files/requirements-py3.txt (limited to 'docker') diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver index 1bc93c2..d1cb1cc 100644 --- a/docker/Dockerfile_codeserver +++ b/docker/Dockerfile_codeserver @@ -2,7 +2,13 @@ FROM ubuntu:16.04 MAINTAINER FOSSEE -RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y +RUN apt-get update && \ +apt-get install -y software-properties-common && \ +echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ +add-apt-repository -y ppa:webupd8team/java && \ +apt-get update && \ +apt-get install -y oracle-java8-installer && \ +apt-get install git python3-pip vim libmysqlclient-dev sudo -y VOLUME /Sites/online_test diff --git a/docker/Files/requirements-codeserver.txt b/docker/Files/requirements-codeserver.txt deleted file mode 100644 index e9585fa..0000000 --- a/docker/Files/requirements-codeserver.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest -python-decouple -six -requests -tornado -psutil diff --git a/docker/Files/requirements-common.txt b/docker/Files/requirements-common.txt deleted file mode 100644 index b4d2e5b..0000000 --- a/docker/Files/requirements-common.txt +++ /dev/null @@ -1,9 +0,0 @@ --r requirements-codeserver.txt -invoke==0.21.0 -django==1.9.5 -django-taggit==0.18.1 -pytz==2016.4 -python-social-auth==0.2.19 -selenium==2.53.6 -coverage -ruamel.yaml==0.15.23 \ No newline at end of file diff --git a/docker/Files/requirements-py2.txt b/docker/Files/requirements-py2.txt deleted file mode 100644 index 38777a1..0000000 --- a/docker/Files/requirements-py2.txt +++ /dev/null @@ -1,2 +0,0 @@ --r requirements-common.txt -mysql-python==1.2.5 diff --git a/docker/Files/requirements-py3.txt b/docker/Files/requirements-py3.txt deleted file mode 100644 index 3d13335..0000000 --- a/docker/Files/requirements-py3.txt +++ /dev/null @@ -1,2 +0,0 @@ --r requirements-common.txt -mysqlclient==1.3.9 -- cgit From 692c452323d39665191b3934f712e774258e31a1 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 26 Dec 2017 16:32:08 +0530 Subject: Multiple changes: - Modify JDK & JRE installation command - Remove vim installation command --- docker/Dockerfile_codeserver | 2 +- docker/Dockerfile_django | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver index d1cb1cc..0112c88 100644 --- a/docker/Dockerfile_codeserver +++ b/docker/Dockerfile_codeserver @@ -8,7 +8,7 @@ echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | de add-apt-repository -y ppa:webupd8team/java && \ apt-get update && \ apt-get install -y oracle-java8-installer && \ -apt-get install git python3-pip vim libmysqlclient-dev sudo -y +apt-get install git python3-pip libmysqlclient-dev sudo default-jre default-jdk -y VOLUME /Sites/online_test diff --git a/docker/Dockerfile_django b/docker/Dockerfile_django index 6b87afb..daddc45 100644 --- a/docker/Dockerfile_django +++ b/docker/Dockerfile_django @@ -4,7 +4,7 @@ MAINTAINER FOSSEE RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y -RUN apt-get install apache2 vim libapache2-mod-wsgi-py3 python3-django -y && mkdir -p /Sites/online_test +RUN apt-get install apache2 libapache2-mod-wsgi-py3 python3-django -y && mkdir -p /Sites/online_test VOLUME /Sites/online_test -- cgit From 280216008e6906c8418e29610e3b5b593908e915 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 26 Dec 2017 16:36:01 +0530 Subject: Remove makefile --- docker/Makefile | 61 --------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 docker/Makefile (limited to 'docker') diff --git a/docker/Makefile b/docker/Makefile deleted file mode 100644 index 9119601..0000000 --- a/docker/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -help: - @echo "Docker Compose Help for Deploying Yaksh interface" - @echo "-----------------------\n" - @echo "Clone yaksh online interface from github :" - @echo " make clone" - @echo "" - @echo "Build docker images:" - @echo " make build" - @echo "" - @echo "To run containers:" - @echo " make start" - @echo "" - @echo "You need to create super a user to work with yaksh:" - @echo " make createsuperuser" - @echo "" - @echo "Now Your interface is ready. You can access it using browser just go to http://localhost:8000" - @echo "" - @echo "Really, really start over:" - @echo " make clean" - @echo "" - @echo "other utilities:restart,tail,status" - -begin: migrate fixtures start - -clone: - @/bin/bash clone-yaksh.sh - -start: - @docker-compose up -d - -stop: - @docker-compose stop - -status: - @docker-compose ps - -restart: stop start - -clean: stop - @docker-compose rm --force - -build: - @docker-compose build --no-cache - @docker pull mariadb:10.2 - -createsuperuser: migrate superuser - -migrate: - @docker exec -it yaksh_django python3 manage.py makemigrations - @docker exec -it yaksh_django python3 manage.py migrate - -superuser: - @docker exec -it yaksh_django python3 manage.py createsuperuser - @docker exec -it yaksh_django python3 manage.py add_group - @docker exec -it yaksh_django python3 manage.py collectstatic - @echo "You can access it using browser, just go to http://localhost:8000" - -tail: - @docker-compose logs -f - -.PHONY: start stop status restart clean build migrate tail clone superuser createsuperuser -- cgit From ca9e214a28dd0546855863041efe7e6d8de6710e Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 28 Dec 2017 14:48:10 +0530 Subject: - Modify code server docker file to remove Oracle JDK, JRE - Add decorator to tasks --- docker/Dockerfile_codeserver | 5 ----- 1 file changed, 5 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver index 0112c88..955e681 100644 --- a/docker/Dockerfile_codeserver +++ b/docker/Dockerfile_codeserver @@ -3,11 +3,6 @@ FROM ubuntu:16.04 MAINTAINER FOSSEE RUN apt-get update && \ -apt-get install -y software-properties-common && \ -echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ -add-apt-repository -y ppa:webupd8team/java && \ -apt-get update && \ -apt-get install -y oracle-java8-installer && \ apt-get install git python3-pip libmysqlclient-dev sudo default-jre default-jdk -y VOLUME /Sites/online_test -- cgit From 9a67cce12061fe63b526fdfbe03a03f6e859a044 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 28 Dec 2017 19:25:51 +0530 Subject: Add docker related changes --- docker/Dockerfile_codeserver | 2 +- docker/Files/Docker-script.sh | 6 ++++-- docker/Files/Start-codeserver.sh | 7 +++---- docker/docker-compose.yml | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver index 955e681..1f030d5 100644 --- a/docker/Dockerfile_codeserver +++ b/docker/Dockerfile_codeserver @@ -11,7 +11,7 @@ ADD Files/requirements-* /tmp/ RUN pip3 install -r /tmp/requirements-codeserver.txt && mkdir -p /Sites/online_test/yaksh_data/output /Sites/online_test/yaksh_data/data -WORKDIR /Sites/online_test/yaksh_data +WORKDIR /Sites/online_test ADD Files/Start-codeserver.sh /Sites diff --git a/docker/Files/Docker-script.sh b/docker/Files/Docker-script.sh index 752a638..dc35a3f 100644 --- a/docker/Files/Docker-script.sh +++ b/docker/Files/Docker-script.sh @@ -1,5 +1,7 @@ #!/bin/bash -chown -R www-data /Sites/online_test -chmod -R 644 /Sites/online_test +chown -R www-data /Sites/online_test +chown -R www-data /Sites/online_test/yaksh +chown -R nobody /Sites/online_test/yaksh_data +chmod -R 664 /Sites/online_test chmod -R +X /Sites /usr/sbin/apache2ctl -D FOREGROUND diff --git a/docker/Files/Start-codeserver.sh b/docker/Files/Start-codeserver.sh index 8b6ea96..019a31d 100644 --- a/docker/Files/Start-codeserver.sh +++ b/docker/Files/Start-codeserver.sh @@ -1,7 +1,6 @@ #!/bin/bash -chown -R nobody /Sites/online_test +chown -R nobody /Sites/online_test/yaksh_data chmod -R a+rwX yaksh_data/output -chmod -R a+rX yaksh_data/data yaksh_data/yaksh -chmod -R o-w yaksh_data/data yaksh -chmod -R +X /Sites/online_test/ +chmod -R a+rX yaksh_data/data +chmod -R o-w yaksh_data/data /usr/bin/sudo -su nobody python3 -m yaksh.code_server diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 747cbda..7ee3860 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -26,7 +26,7 @@ services: image: yaksh.codeserver container_name: yaksh_codeserver volumes: - - ../yaksh_data:/Sites/online_test/yaksh_data + - ..:/Sites/online_test restart: always -- cgit From 2846e4372bb5d255c9b4405456b133f174916893 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 2 Jan 2018 18:24:27 +0530 Subject: - Update README_production.rst to fix incorrect commands, links and formatting - Remove README inside docker folder --- docker/README.md | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 docker/README.md (limited to 'docker') diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 34e30da..0000000 --- a/docker/README.md +++ /dev/null @@ -1,30 +0,0 @@ -#### Pre-Requisites - - 1. Install Docker https://docs.docker.com/engine/installation/ - 2. Install Docker Compose https://docs.docker.com/compose/install/#install-compose - 3. install git - - -#### Help for deploying Yaksh interface. - - - To get help while deployment - $ make help - - - Clone yaksh form github: - $ make clone - - - Build docker images: - $ make build - - - To run containers: - $ make start - - - You need to create super a user to work with yaksh: - $ make createsuperuser - - - Now Your interface is ready. You can access it using browser just go to http://localhost:8000 - - - Clean your docker containers: - $ make clean - - - other utilities like restart, tail, status -- cgit