@@ -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
5456LABEL maintainer="Public Knowledge Project <marc.bria@uab.es>"
5557LABEL org.opencontainers.image.vendor="Public Knowledge Project"
5658LABEL org.opencontainers.image.title="PKP ${BUILD_PKP_TOOL} Web Application"
5759LABEL 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:
6163ENV 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
114116RUN 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
118122RUN 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
121126RUN echo "PKP_CONF: ${PKP_CONF}"
122127RUN 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
150160EXPOSE 80
151161EXPOSE 443
0 commit comments