diff options
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile_codeserver | 20 | ||||
-rw-r--r-- | docker/Dockerfile_django | 23 | ||||
-rw-r--r-- | docker/Files/000-default.conf | 18 | ||||
-rw-r--r-- | docker/Files/Docker-script.sh | 7 | ||||
-rw-r--r-- | docker/Files/Start-codeserver.sh | 6 | ||||
-rw-r--r-- | docker/docker-compose.yml | 41 |
6 files changed, 115 insertions, 0 deletions
diff --git a/docker/Dockerfile_codeserver b/docker/Dockerfile_codeserver new file mode 100644 index 0000000..1f030d5 --- /dev/null +++ b/docker/Dockerfile_codeserver @@ -0,0 +1,20 @@ +FROM ubuntu:16.04 + +MAINTAINER FOSSEE <pythonsupport@fossee.in> + +RUN apt-get update && \ +apt-get install git python3-pip libmysqlclient-dev sudo default-jre default-jdk -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 + +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..daddc45 --- /dev/null +++ b/docker/Dockerfile_django @@ -0,0 +1,23 @@ +FROM ubuntu:16.04 + +MAINTAINER FOSSEE <pythonsupport@fossee.in> + +RUN apt-get update -y && apt-get install git python3-pip vim libmysqlclient-dev sudo -y + +RUN apt-get install apache2 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 @@ +<VirtualHost *:80> + 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/ + <Directory /Sites/online_test > + WSGIProcessGroup yaksh + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + Require all granted + </Directory> + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined +</VirtualHost> diff --git a/docker/Files/Docker-script.sh b/docker/Files/Docker-script.sh new file mode 100644 index 0000000..dc35a3f --- /dev/null +++ b/docker/Files/Docker-script.sh @@ -0,0 +1,7 @@ +#!/bin/bash +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 new file mode 100644 index 0000000..019a31d --- /dev/null +++ b/docker/Files/Start-codeserver.sh @@ -0,0 +1,6 @@ +#!/bin/bash +chown -R nobody /Sites/online_test/yaksh_data +chmod -R a+rwX yaksh_data/output +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 new file mode 100644 index 0000000..7ee3860 --- /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: + - ..:/Sites/online_test + 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 |