FROM python:3-slim MAINTAINER Joerg Holetschek # sudo docker run -it --name=biocase python:3-buster # Add this folder so that installing default-jre won't fail RUN mkdir /usr/share/man/man1 RUN apt-get update RUN apt-get install -y apache2 subversion RUN apt-get install -y nano graphviz default-jre-headless # optional RUN apt-get install -y g++ unixodbc-dev libmariadb-dev # required for compiling pyodbc and mysqlclient # Java 8 #RUN apt-get install -y software-properties-common #RUN apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main' #RUN apt-get update #RUN apt-get install -y openjdk-8-jdk-headless RUN pip install lxml pyodbc pymssql psycopg2-binary mysqlclient fdb # Some cleanup RUN apt-get autoremove -y g++ # was just needed for compiling RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Set Apache environment variables ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_PID_FILE /var/run/apache2/apache2.pid ENV APACHE_RUN_DIR /var/run/apache2 # Enable cgi RUN /usr/sbin/a2enmod cgid # Checkout BioCASe, change owner RUN cd /opt/ && svn export http://ww2.biocase.org/svn/bps2/trunk biocase RUN chown -R www-data:www-data /opt/biocase # Set bpsPath in lib/biocase/addjustpath.py to r'/opt/biocase' RUN sed -i 's/C:\\Workspace\\bps3/\/opt\/biocase/g' /opt/biocase/lib/biocase/adjustpath.py # chdir to tools, then run fixpermissions.py RUN cd /opt/biocase/tools && python fixpermissions.py # Set up virtual host and expose HTTP port (add "EXPOSE 443" for HTTPS) RUN sed -i 's//ServerName localhost\n/g' /etc/apache2/sites-enabled/000-default.conf RUN sed -i 's/<\/VirtualHost>/\n\nAlias \/biocase "\/opt\/biocase\/www"\n\n\tAllowOverride None\n\tOrder allow,deny\n\tAllow from all\n\tOptions \+ExecCGI \+Indexes\n\tAddHandler cgi-script cgi\n\tDirectoryIndex index\.cgi index\.html\n\tRequire all granted\n<\/Directory>\n\n<\/VirtualHost>/g' /etc/apache2/sites-enabled/000-default.conf EXPOSE 80 # Start Apache CMD rm -f /var/run/apache2/apache2.pid ; /usr/sbin/apache2ctl -D FOREGROUND # Start BioCASe after creating the image # sudo docker run -d -p8181:80 --name=biocase --hostname=biocase --mount source=bps_config,target=/opt/biocase/config "biocase/bps:latest"