|
| 1 | +FROM islandora/nginx:6.0.1@sha256:20d8b36e812c60bfabccdbfbee0f40d46733df921a4ea9de0a2fa943f88f4fb5 |
| 2 | + |
| 3 | +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] |
| 4 | + |
| 5 | +EXPOSE 80 |
| 6 | + |
| 7 | +WORKDIR /var/www/ojs |
| 8 | + |
| 9 | +ARG \ |
| 10 | + # renovate: datasource=repology depName=alpine_3_22/npm |
| 11 | + NPM_VERSION=11.3.0-r1 \ |
| 12 | + # renovate: datasource=github-tags depName=ojs packageName=pkp/ojs |
| 13 | + OJS_VERSION=3_5_0-1 \ |
| 14 | + # renovate: datasource=repology depName=alpine_3_22/php83 |
| 15 | + PHP_VERSION=8.3.26-r0 |
| 16 | + |
| 17 | +RUN apk add --no-cache \ |
| 18 | + npm=="${NPM_VERSION}" \ |
| 19 | + php83-bcmath=="${PHP_VERSION}" \ |
| 20 | + php83-ftp=="${PHP_VERSION}" \ |
| 21 | + php83-gettext=="${PHP_VERSION}" \ |
| 22 | + && cleanup.sh |
| 23 | + |
| 24 | +RUN git clone https://github.com/pkp/ojs.git . \ |
| 25 | + && git checkout ${OJS_VERSION} \ |
| 26 | + && git submodule update --init --recursive \ |
| 27 | + && rm -rf .github tests docs \ |
| 28 | + && composer -d lib/pkp install \ |
| 29 | + && composer -d plugins/generic/citationStyleLanguage install \ |
| 30 | + && composer -d plugins/paymethod/paypal install \ |
| 31 | + && rm -rf .git \ |
| 32 | + # modify composer.json to be at least a week old so we can run composer install for contrib plugins |
| 33 | + && NOW=$(date +%s) \ |
| 34 | + && SEVEN_DAYS_AGO=$((NOW - 604800)) \ |
| 35 | + && OLDDATE=$(date -d @${SEVEN_DAYS_AGO} +%Y%m%d%H%M.%S) \ |
| 36 | + && find /var/www/ojs/plugins -type f -name "composer.json" -exec touch -t "$OLDDATE" {} \; |
| 37 | + |
| 38 | +RUN npm install \ |
| 39 | + && npm run build \ |
| 40 | + && rm -rf node_modules |
| 41 | + |
| 42 | +RUN chown -R nginx:nginx /var/www/ojs |
| 43 | + |
| 44 | +ENV \ |
| 45 | + OJS_DB_HOST=mariadb \ |
| 46 | + OJS_DB_PORT=3306 \ |
| 47 | + OJS_DB_NAME=ojs \ |
| 48 | + OJS_DB_USER=changeme \ |
| 49 | + OJS_DB_PASSWORD=changeme \ |
| 50 | + OJS_SALT=changeme \ |
| 51 | + OJS_API_KEY_SECRET=changeme \ |
| 52 | + OJS_ADMIN_USERNAME=admin \ |
| 53 | + OJS_ADMIN_EMAIL=admin@localhost \ |
| 54 | + OJS_ADMIN_PASSWORD=changeme \ |
| 55 | + OJS_LOCALE=en \ |
| 56 | + OJS_TIMEZONE=UTC \ |
| 57 | + OJS_FILES_DIR=/var/www/files \ |
| 58 | + OJS_OAI_REPOSITORY_ID=ojs.localhost \ |
| 59 | + OJS_ENABLE_BEACON=1 \ |
| 60 | + # see https://github.com/Islandora-Devops/isle-buildkit/tree/main/nginx#nginx-settings |
| 61 | + PHP_MAX_EXECUTION_TIME=300 \ |
| 62 | + PHP_MAX_INPUT_TIME=300 \ |
| 63 | + PHP_DEFAULT_SOCKET_TIMEOUT=300 \ |
| 64 | + PHP_REQUEST_TERMINATE_TIMEOUT=300 \ |
| 65 | + PHP_MEMORY_LIMIT=256M \ |
| 66 | + NGINX_FASTCGI_READ_TIMEOUT=300s \ |
| 67 | + NGINX_FASTCGI_SEND_TIMEOUT=300s \ |
| 68 | + NGINX_FASTCGI_CONNECT_TIMEOUT=300s |
| 69 | + |
| 70 | +COPY --link rootfs / |
| 71 | + |
| 72 | +# run composer install on any plugins added from ./rootfs/var/www/ojs/plugins (files modified within last day) |
| 73 | +RUN find /var/www/ojs/plugins -type f -name "composer.json" -mtime -1 | while read -r COMPOSER_JSON; do \ |
| 74 | + composer install --no-dev --optimize-autoloader -d "$(dirname "$COMPOSER_JSON")"; \ |
| 75 | + done |
0 commit comments