Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit b0c6f24

Browse files
committed
Unify oxs-tools to a single pkp-tools folder. Improve container.version output
1 parent c4cbf4a commit b0c6f24

File tree

22 files changed

+128
-308
lines changed

22 files changed

+128
-308
lines changed

.env

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
# Set your journal Tag:
2-
COMPOSE_PROJECT_NAME=demo
3-
PROJECT_DOMAIN=demo.localhost
2+
COMPOSE_PROJECT_NAME="${PKP_TOOL:-pkp}"
3+
PROJECT_DOMAIN="${PKP_TOOL:-pkp}".localhost
44
SERVERNAME=$PROJECT_DOMAIN
55

66
# Web Server:
7-
# PHP_INI_DIR=/etc/php/8.1
7+
# PHP_INI_DIR="/etc/php/8.1"
8+
HTTP_PORT=8081
9+
HTTPS_PORT=8444
810
HTTPS="on"
9-
WEB_PATH=/var/www/html
10-
# HTTP_PORT=8100
11-
# HTTPS_PORT=8500
12-
13-
# PKP Tool:
14-
PKP_TOOL=omp
15-
PKP_VERSION=3.3.0-21
11+
WEB_PATH="/var/www/html"
1612

1713
# Database:
1814
# MYSQL_VERSION=10.3
19-
MYSQL_ROOT_PASSWORD=root
20-
MYSQL_USER=omp
21-
MYSQL_PASSWORD=changeYourPass
22-
MYSQL_DATABASE=omp
23-
24-
# To autoinstall (experimental):
25-
# Warning: Former vars can be referenced. Be sure MYSQL_* and OJS_* are consistent.
26-
OJS_CLI_INSTALL=0
27-
OJS_DB_HOST=db
28-
OJS_DB_DRIVER=mysqli
29-
OJS_DB_USER=omp
30-
OJS_DB_PASSWORD=changeYourPass
31-
OJS_DB_NAME=omp
32-
OJS_WEB_CONF=/etc/apache2/conf.d/ojs.conf
33-
OJS_CONF=/var/www/html/config.inc.php
15+
MYSQL_ROOT_PASSWORD=changeRootPlease
16+
MYSQL_USER=pkp
17+
MYSQL_PASSWORD=changeMePlease
18+
MYSQL_DATABASE=pkp
3419

20+
# PKP Tool:
21+
PKP_TOOL="${PKP_TOOL:-omp}"
22+
PKP_VERSION="${PKP_VERSION:-3.3.0-21}"
23+
PKP_CLI_INSTALL=0
24+
PKP_DB_HOST=db
25+
PKP_DB_DRIVER=mysqli
26+
PKP_DB_USER=pkp
27+
PKP_DB_PASSWORD=changeMePlease
28+
PKP_DB_NAME=pkp
29+
PKP_WEB_CONF="/etc/apache2/conf-enabled/pkp.conf"
30+
PKP_CONF="/var/www/html/config.inc.php"

Dockerfile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ FROM ${BUILD_WEB_SERVER}
4646
# - Redirect log output to stdout & FILE.
4747

4848
# Context
49-
ARG BUILD_PKP_TOOL \
50-
BUILD_PKP_VERSION \
51-
BUILD_LABEL \
52-
BUILD_PKP_APP_PATH
49+
ARG BUILD_PKP_TOOL \
50+
BUILD_PKP_VERSION \
51+
BUILD_PKP_APP_PATH \
52+
BUILD_WEB_SERVER \
53+
BUILD_LABEL
54+
5355

5456
LABEL maintainer="Public Knowledge Project <marc.bria@uab.es>"
5557
LABEL org.opencontainers.image.vendor="Public Knowledge Project"
5658
LABEL org.opencontainers.image.title="PKP ${BUILD_PKP_TOOL} Web Application"
5759
LABEL org.opencontainers.image.description="Runs a ${BUILD_PKP_TOOL} application over ${BUILD_WEB_SERVER}-${BUILD_OS}."
58-
LABEL build_version="${BUILD_PKP_TOOL} ${BUILD_PKP_VERSION} - Build-date: ${BUILD_LABEL}"
60+
LABEL build_version="${BUILD_PKP_TOOL}_${BUILD_PKP_VERSION}_${BUILD_LABEL}"
5961

6062
# ARGs only work during building time, so they need to be exported to ENVs:
6163
ENV PKP_TOOL="${BUILD_PKP_TOOL:-ojs}" \
@@ -70,7 +72,7 @@ ENV PKP_TOOL="${BUILD_PKP_TOOL:-ojs}" \
7072
PKP_DB_USER="${MYSQL_USER:-pkp}" \
7173
PKP_DB_PASSWORD="${MYSQL_PASSWORD:-changeMe}" \
7274
PKP_DB_NAME="${MYSQL_DATABASE:-pkp}" \
73-
PKP_WEB_CONF="/etc/apache2/conf.d/pkp.conf" \
75+
PKP_WEB_CONF="/etc/apache2/conf-enabled/pkp.conf" \
7476
PKP_CONF="config.inc.php" \
7577
PKP_CMD="/usr/local/bin/pkp-start"
7678

@@ -112,11 +114,14 @@ COPY --from=pkp_code "${BUILD_PKP_APP_PATH}" .
112114

113115
# Create directories
114116
RUN mkdir -p /etc/ssl/apache2 "${WWW_PATH_ROOT}/files" /run/apache2
115-
# Make php/conf.d indpendent of the php version:
116-
RUN PHP_INI_DIR=$(php --ini | grep "Configuration File (php.ini) Path" | cut -d: -f2 | xargs) \
117+
118+
# Make php's etc indpendent of the php versio:
119+
RUN PHP_INI_DIR=$(php --ini | grep "Configuration File (php.ini) Path" | cut -d: -f2 | xargs)
120+
117121
# Redirect logs to stdout
118122
RUN echo "log_errors = On" >> $PHP_INI_DIR/conf.d/log-errors.ini \
119123
&& echo "error_log = /dev/stderr" >> $PHP_INI_DIR/conf.d/log-errors.ini
124+
120125
# PKP-app config
121126
RUN echo "PKP_CONF: ${PKP_CONF}"
122127
RUN cp -a config.TEMPLATE.inc.php "${WWW_PATH_ROOT}/html/${PKP_CONF}"
@@ -141,11 +146,16 @@ RUN apt-get clean autoclean \
141146
# && find . -name "test" -exec rm -Rf '{}' \; \
142147
# && find . \( -name .gitignore -o -name .gitmodules -o -name .keepme \) -exec rm -Rf '{}' \;
143148

144-
COPY "templates/common/$BUILD_PKP_TOOL/root/" /
149+
COPY "templates/pkp/root/" /
150+
COPY "volumes/config/apache.pkp.conf" "${PKP_WEB_CONF}"
145151

146-
RUN echo "${BUILD_PKP_TOOL}-${BUILD_PKP_VERSION} over $BUILD_WEB_SERVER on $BUILD_OS [build:" $(date "+%Y%m%d-%H%M%S") "]" > "${WWW_PATH_ROOT}/container.version" \
147-
&& rm -f "${BUILD_PKP_TOOL}-${BUILD_PKP_VERSION}.tar.gz" \
148-
&& cat "${WWW_PATH_ROOT}/container.version"
152+
#RUN echo "${BUILD_PKP_TOOL}-${BUILD_PKP_VERSION} over $BUILD_WEB_SERVER on $(cat /etc/issue) [build:" $(date "+%Y%m%d-%H%M%S") "]" > "${WWW_PATH_ROOT}/container.version" \
153+
RUN bash -c '\
154+
. /etc/os-release && \
155+
echo "${BUILD_PKP_TOOL}-${BUILD_PKP_VERSION} over ${BUILD_WEB_SERVER} on ${ID}-${VERSION_ID} [build: $(date +%Y%m%d-%H%M%S)]" \
156+
> "${WWW_PATH_ROOT}/container.version"' && \
157+
rm -f "${BUILD_PKP_TOOL}-${BUILD_PKP_VERSION}.tar.gz" && \
158+
cat "${WWW_PATH_ROOT}/container.version"
149159

150160
EXPOSE 80
151161
EXPOSE 443

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ services:
2222
restart: unless-stopped
2323

2424
app:
25-
image: local/${PKP_TOOL:-ojs}:${PKP_VERSION:-3_3_0-21}
25+
# image: local/omp:3.3.0-21-php81
26+
image: local/${PKP_TOOL:-ojs}:${PKP_VERSION:-3_3_0-21-php81-mbr}
2627
build:
2728
context: .
2829
dockerfile: Dockerfile
@@ -41,7 +42,7 @@ services:
4142
# - ./volumes/logs/app:/var/log/apache2
4243
# # WARNING: You can only enable file-volumes if file exists in the container.
4344
# - ./volumes/config/pkp.config.inc.php:/var/www/html/config.inc.php
44-
- ./volumes/config/apache.htaccess:/var/www/html/.htaccess
45+
# - ./volumes/config/apache.htaccess:/var/www/html/.htaccess
4546
- ./volumes/config/php.custom.ini:/usr/local/etc/php/conf.d/custom.ini
4647

4748
networks:

templates/common/ojs/env

Lines changed: 0 additions & 30 deletions
This file was deleted.

templates/common/omp/env

Lines changed: 0 additions & 30 deletions
This file was deleted.

templates/common/omp/root/usr/local/bin/pkp-cli-install

Lines changed: 0 additions & 11 deletions
This file was deleted.

templates/common/omp/root/usr/local/bin/pkp-migrate

Lines changed: 0 additions & 39 deletions
This file was deleted.

templates/common/omp/root/usr/local/bin/pkp-patch

Lines changed: 0 additions & 43 deletions
This file was deleted.

templates/common/omp/root/usr/local/bin/pkp-pre-start

Lines changed: 0 additions & 44 deletions
This file was deleted.

templates/common/omp/root/usr/local/bin/pkp-run-scheduled

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)