🔧 Push release version to Docker image

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-17 11:57:30 +01:00
parent c8576aa757
commit 099b82f13a
3 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ RUN composer --working-dir=/srv install
FROM php:apache
LABEL maintainer="Luke Tainton <luke@tainton.uk>"
ARG VERSION
RUN docker-php-ext-install pdo_mysql && a2enmod rewrite remoteip
COPY vhost.conf /etc/apache2/sites-enabled/000-default.conf
COPY --from=build /srv /srv
RUN echo $VERSION > /srv/includes/VERSION

View File

@@ -1,4 +1,10 @@
<?php
function get_version() {
$version = "v" . file_get_contents(__DIR__ . '/VERSION');
return $version;
}
function get_all_users($db) {
try {
$stmt = "SELECT * FROM users";

View File

@@ -1,7 +1,7 @@
<footer class="footer mt-auto py-3">
<div class="text-center text-muted">
<?php
echo($_ENV['APP_NAME'] . " v" . $_ENV['APP_VERSION']);
echo($_ENV['APP_NAME'] . " " . get_version());
if ($_ENV['APP_NAME'] != "FHeD") {
echo(", powered by FHeD");
};