|
| 1 | +# Open Journal Systems (OJS) Docker Container |
| 2 | + |
| 3 | +Dockerized deployment of [Open Journal Systems](https://pkp.sfu.ca/software/ojs/) based on the [Islandora Buildkit](https://github.com/Islandora-Devops/isle-buildkit) nginx base image. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +1. Generate secrets: |
| 8 | +```bash |
| 9 | +docker compose up init |
| 10 | +``` |
| 11 | + |
| 12 | +2. Start the containers: |
| 13 | +```bash |
| 14 | +docker compose up -d |
| 15 | +``` |
| 16 | + |
| 17 | +3. Access OJS at http://localhost |
| 18 | + |
| 19 | +The installation will run automatically on first startup. The default admin credentials are: |
| 20 | +- Username: `admin` (configurable via `OJS_ADMIN_USERNAME`) |
| 21 | +- Password: Contents of `./secrets/OJS_ADMIN_PASSWORD` |
| 22 | +- Email: `admin@example.com` (configurable via `OJS_ADMIN_EMAIL`) |
| 23 | + |
| 24 | +## Configuration |
| 25 | + |
| 26 | +### OJS Configuration |
| 27 | + |
| 28 | +| Environment Variable | Default | Source | Description | |
| 29 | +| :------------------- | :------ | :----- | :---------- | |
| 30 | +| OJS_DB_HOST | mariadb | environment | MariaDB/MySQL hostname | |
| 31 | +| OJS_DB_PORT | 3306 | environment | MariaDB/MySQL port | |
| 32 | +| OJS_DB_NAME | ojs | environment | Database name | |
| 33 | +| OJS_DB_USER | ojs | environment | Database user | |
| 34 | +| OJS_DB_PASSWORD | (generated) | secret | Database password (stored in `./secrets/OJS_DB_PASSWORD`) | |
| 35 | +| OJS_SALT | (generated) | secret | Salt for password hashing (stored in `./secrets/OJS_SALT`) | |
| 36 | +| OJS_API_KEY_SECRET | (generated) | secret | Secret for API key encoding (stored in `./secrets/OJS_API_KEY_SECRET`) | |
| 37 | +| OJS_ADMIN_USERNAME | admin | environment | Initial admin username | |
| 38 | +| OJS_ADMIN_EMAIL | admin@example.com | environment | Initial admin email | |
| 39 | +| OJS_ADMIN_PASSWORD | (generated) | secret | Initial admin password (stored in `./secrets/OJS_ADMIN_PASSWORD`) | |
| 40 | +| OJS_LOCALE | en | environment | Primary locale/language | |
| 41 | +| OJS_TIMEZONE | UTC | environment | System timezone | |
| 42 | +| OJS_FILES_DIR | /var/www/files | environment | Directory for uploaded files | |
| 43 | +| OJS_OAI_REPOSITORY_ID | ojs.localhost | environment | OAI-PMH repository identifier | |
| 44 | +| OJS_ENABLE_BEACON | 1 | environment | Enable PKP usage statistics beacon (1=enabled, 0=disabled) | |
| 45 | + |
| 46 | +### Nginx and PHP Settings |
| 47 | + |
| 48 | +See https://github.com/Islandora-Devops/isle-buildkit/tree/main/nginx#nginx-settings |
| 49 | + |
| 50 | +## Secrets Management |
| 51 | + |
| 52 | +Secrets are stored in the `./secrets/` directory and mounted into the container at runtime. The `generate-secrets.sh` script creates secure random values for: |
| 53 | + |
| 54 | +- `DB_ROOT_PASSWORD` - MariaDB root password |
| 55 | +- `OJS_DB_PASSWORD` - OJS database user password |
| 56 | +- `OJS_ADMIN_PASSWORD` - OJS admin user password |
| 57 | +- `OJS_API_KEY_SECRET` - Secret for API key encoding/decoding |
| 58 | +- `OJS_SALT` - Salt for password hashing |
| 59 | + |
| 60 | +## Customization |
| 61 | + |
| 62 | +You can customize the installation by: |
| 63 | + |
| 64 | +1. Setting environment variables in `docker-compose.yaml` |
| 65 | +2. Overriding default values in the Dockerfile |
| 66 | +3. Adding custom plugins to `rootfs/var/www/ojs/plugins/` |
| 67 | + |
| 68 | +### Adding Plugins |
| 69 | + |
| 70 | +Place plugin directories in the appropriate subdirectory under `rootfs/var/www/ojs/plugins/`: |
| 71 | + |
| 72 | +- `blocks/` - Block plugins |
| 73 | +- `gateways/` - Gateway plugins |
| 74 | +- `generic/` - Generic plugins |
| 75 | +- `importexport/` - Import/export plugins |
| 76 | +- `metadata/` - Metadata plugins |
| 77 | +- `oaiMetadataFormats/` - OAI metadata format plugins |
| 78 | +- `paymethod/` - Payment method plugins |
| 79 | +- `pubIds/` - Public identifier plugins |
| 80 | +- `reports/` - Report plugins |
| 81 | +- `themes/` - Theme plugins |
| 82 | + |
| 83 | +Plugins with `composer.json` files will automatically have their dependencies installed during the build. |
| 84 | + |
| 85 | +## Volumes |
| 86 | + |
| 87 | +The following volumes are created for data persistence: |
| 88 | + |
| 89 | +- `mariadb-data` - MariaDB database files |
| 90 | +- `ojs-cache` - OJS cache files |
| 91 | +- `ojs-files` - Uploaded files (submissions, etc.) |
| 92 | +- `ojs-public` - Public files |
| 93 | + |
| 94 | +## Updating OJS Version |
| 95 | + |
| 96 | +To update the OJS version, modify the `OJS_VERSION` build argument in the Dockerfile: |
| 97 | + |
| 98 | +```dockerfile |
| 99 | +ARG OJS_VERSION=3_5_0-1 |
| 100 | +``` |
| 101 | + |
| 102 | +Version tags follow the format used in the [PKP OJS repository](https://github.com/pkp/ojs/tags). |
| 103 | + |
| 104 | +## Troubleshooting |
| 105 | + |
| 106 | +### Installation Logs |
| 107 | + |
| 108 | +If the automatic installation fails, check the container logs: |
| 109 | + |
| 110 | +```bash |
| 111 | +docker compose logs ojs |
| 112 | +``` |
| 113 | + |
| 114 | +### Database Connection Issues |
| 115 | + |
| 116 | +Ensure the MariaDB container is healthy before the OJS container starts: |
| 117 | + |
| 118 | +```bash |
| 119 | +docker compose ps |
| 120 | +``` |
| 121 | + |
| 122 | +### Resetting Installation |
| 123 | + |
| 124 | +To completely reset and reinstall: |
| 125 | + |
| 126 | +```bash |
| 127 | +docker compose down -v |
| 128 | +./scripts/generate-secrets.sh |
| 129 | +docker compose up -d |
| 130 | +``` |
| 131 | + |
| 132 | +## License |
| 133 | + |
| 134 | +This Docker implementation is provided as-is. Open Journal Systems is licensed under the GNU General Public License v3. See the [OJS repository](https://github.com/pkp/ojs) for details. |
0 commit comments