Skip to content

Commit 420c128

Browse files
committed
Initial commit.
0 parents  commit 420c128

26 files changed

Lines changed: 938 additions & 0 deletions

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git/
2+
.env
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: lint-test
2+
on:
3+
push:
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
lint-test:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
13+
14+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
15+
16+
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
17+
18+
build-push:
19+
needs: [lint-test]
20+
uses: libops/.github/.github/workflows/build-push-ghcr.yaml@main
21+
permissions:
22+
contents: read
23+
packages: write
24+
secrets: inherit
25+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.env
2+
secrets
3+
!secrets/.keep
4+
docker-compose.override.yaml

Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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

docker-compose.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
volumes:
3+
mariadb-data: {}
4+
ojs-cache: {}
5+
ojs-files: {}
6+
ojs-public: {}
7+
8+
secrets:
9+
DB_ROOT_PASSWORD:
10+
file: ./secrets/DB_ROOT_PASSWORD
11+
OJS_DB_PASSWORD:
12+
file: ./secrets/OJS_DB_PASSWORD
13+
OJS_API_KEY_SECRET:
14+
file: ./secrets/OJS_API_KEY_SECRET
15+
OJS_SALT:
16+
file: ./secrets/OJS_SALT
17+
services:
18+
ojs:
19+
image: ghcr.io/libops/ojs:main
20+
build: .
21+
ports:
22+
- 80:80
23+
environment:
24+
OJS_DB_HOST: mariadb
25+
OJS_DB_USER: ojs
26+
secrets:
27+
- source: DB_ROOT_PASSWORD
28+
- source: OJS_API_KEY_SECRET
29+
- source: OJS_DB_PASSWORD
30+
- source: OJS_SALT
31+
volumes:
32+
- ojs-cache:/var/www/ojs/cache:rw
33+
- ojs-files:/var/www/files:rw
34+
- ojs-public:/var/www/ojs/public:rw
35+
depends_on:
36+
- mariadb
37+
mariadb:
38+
image: islandora/mariadb:6.0.1@sha256:335df4225634f14095b337847e541d65b5abfa2fe051c7e2b93fae447cac1e58
39+
volumes:
40+
- mariadb-data:/var/lib/mysql:rw
41+
secrets:
42+
- source: DB_ROOT_PASSWORD

renovate.json5

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: [
4+
'github>libops/renovate-config:default.json5',
5+
],
6+
}
7+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[template]
2+
src = "config.inc.tmpl"
3+
dest = "/var/www/ojs/config.inc.php"
4+
uid = 100
5+
gid = 1000
6+
mode = "0640"
7+
keys = [ "/" ]

0 commit comments

Comments
 (0)