Просмотр исходного кода

Pone versión según si es openshift o no

Celestino Rey 1 год назад
Родитель
Сommit
f19ff72b3c
2 измененных файлов с 9 добавлено и 7 удалено
  1. 1 7
      Dockerfile.k8s
  2. 8 0
      src/templates/acerca_de.html

+ 1 - 7
Dockerfile.k8s

@@ -33,9 +33,6 @@ RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.t
 
 FROM python:3.11.4-slim-buster
 
-# create the app user
-#RUN addgroup --system app && adduser --system --group app
-
 # create the appropriate directories
 ENV APP_HOME=/app
 RUN mkdir -p $APP_HOME
@@ -56,11 +53,8 @@ COPY ./entrypoint.sh .
 # copy project
 COPY . $APP_HOME
 
-# chown all the files to the app user
-#RUN chown -R app:app $APP_HOME
-
 # change to the app user
-#USER app
+
 WORKDIR $APP_HOME/src
 
 # run entrypoint.sh

+ 8 - 0
src/templates/acerca_de.html

@@ -1,5 +1,7 @@
 {% extends "base.html" %}
 
+{% load filtros_de_entorno %}
+
 {% block content %}
 <div class="container-xl">
     <h1 class="app-page-title">Acerca de...</h1>
@@ -10,7 +12,13 @@
                     <ul class="list-unstyled">
                         <li><strong>Nombre de la aplicación:</strong> {{ app_name }}</li>
                         <li><strong>Versión:</strong> {{ app_version }}</li>
+
+                    {% if 'OPENSHIFT'|muestra_version == 'True' %}
+                        <li><strong>Versión de la imagen:</strong> openshift </li>
+                    {% else %}
                         <li><strong>Versión de la imagen:</strong> {{ img_version }}</li>
+                    {% endif %}
+
                     </ul>
                 </div><!--//app-card-body-->
             </div><!--//app-card-->