diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bfd0d42 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,50 @@ +FROM ubuntu:latest +MAINTAINER Montala Ltd +ENV DEBIAN_FRONTEND="noninteractive" +RUN apt-get update && apt-get install -y \ + nano \ + imagemagick \ + apache2 \ + subversion \ + ghostscript \ + antiword \ + poppler-utils \ + libimage-exiftool-perl \ + cron \ + postfix \ + wget \ + php \ + php-apcu \ + php-curl \ + php-dev \ + php-gd \ + php-intl \ + php-mysqlnd \ + php-mbstring \ + php-zip \ + libapache2-mod-php \ + ffmpeg \ + libopencv-dev \ + python3-opencv \ + python3 \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* +RUN sed -i -e "s/upload_max_filesize\s*=\s*2M/upload_max_filesize = 100M/g" /etc/php/8.3/apache2/php.ini +RUN sed -i -e "s/post_max_size\s*=\s*8M/post_max_size = 100M/g" /etc/php/8.3/apache2/php.ini +RUN sed -i -e "s/max_execution_time\s*=\s*30/max_execution_time = 300/g" /etc/php/8.3/apache2/php.ini +RUN sed -i -e "s/memory_limit\s*=\s*128M/memory_limit = 1G/g" /etc/php/8.3/apache2/php.ini + +RUN printf '\n\ +\tOptions FollowSymLinks\n\ +\n'\ +>> /etc/apache2/sites-enabled/000-default.conf + +ADD cronjob /etc/cron.daily/resourcespace + +WORKDIR /var/www/html +RUN rm index.html +RUN svn co -q https://svn.resourcespace.com/svn/rs/releases/10.5 . +RUN mkdir filestore +RUN chmod 777 filestore +RUN chmod -R 777 include/ +CMD apachectl -D FOREGROUND diff --git a/cronjob b/cronjob new file mode 100644 index 0000000..cd2e9a2 --- /dev/null +++ b/cronjob @@ -0,0 +1,2 @@ +#!/bin/sh +su -s /bin/sh -c 'cd /var/www/html/pages/tools && nice -n 19 ionice -c2 -n7 php cron_copy_hitcount.php' www-data diff --git a/db.env b/db.env new file mode 100644 index 0000000..234f5dc --- /dev/null +++ b/db.env @@ -0,0 +1,4 @@ +MYSQL_PASSWORD=change-me +MYSQL_ROOT_PASSWORD=change-me +MYSQL_DATABASE=resourcespace +MYSQL_USER=resourcespace_rw \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..d27e2a6 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,36 @@ +services: + resourcespace: + build: . + container_name: resourcespace + restart: unless-stopped + depends_on: + - mariadb + volumes: + - include:/var/www/html/include + - filestore:/var/www/html/filestore + - ./testdir:/srv/storage/testdir + networks: + - frontend + - backend + ports: + - "80:80" + + mariadb: + image: mariadb + container_name: mariadb + restart: unless-stopped + env_file: + - db.env + volumes: + - mariadb:/var/lib/mysql + networks: + - backend + +networks: + frontend: + backend: + +volumes: + mariadb: + include: + filestore: