From 5ae0ce89637135faa02c2b37fd17937da6736a60 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 4 Apr 2025 11:05:54 +0200 Subject: [PATCH] Importa solo nuevos repostajes. Arreglos en montaje de directorios --- Dockerfile.k8s | 7 +------ K8S/Makefile | 2 +- K8S/env-prod-configmap.yaml | 3 +++ K8S/reymota-deployment.yaml | 26 ++++++++++++++++++++------ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Dockerfile.k8s b/Dockerfile.k8s index faa147b..23368f3 100644 --- a/Dockerfile.k8s +++ b/Dockerfile.k8s @@ -33,18 +33,13 @@ RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.t FROM python:3.11.4-slim-buster - -# create directory for the app user -RUN mkdir -p /app - # 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 -#RUN mkdir -p $APP_HOME/staticfiles -#RUN mkdir -p $APP_HOME/mediafiles + WORKDIR $APP_HOME # install system dependencies diff --git a/K8S/Makefile b/K8S/Makefile index 3c3b1e7..17e2c69 100644 --- a/K8S/Makefile +++ b/K8S/Makefile @@ -1,6 +1,6 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.62 +export IMG_VERSION = 0.66 export IMG_NGINX_VERSION = 1.0 # limpia todo diff --git a/K8S/env-prod-configmap.yaml b/K8S/env-prod-configmap.yaml index d5bd33a..e10eec3 100644 --- a/K8S/env-prod-configmap.yaml +++ b/K8S/env-prod-configmap.yaml @@ -3,6 +3,9 @@ data: DEBUG: "False" ENTORNO: "Producción" SECRET_KEY: change_me + SQL_HOST: postgresql + SQL_PORT: "5432" + DATABASE: postgres kind: ConfigMap metadata: labels: diff --git a/K8S/reymota-deployment.yaml b/K8S/reymota-deployment.yaml index 04b65e7..971a297 100644 --- a/K8S/reymota-deployment.yaml +++ b/K8S/reymota-deployment.yaml @@ -53,21 +53,35 @@ spec: configMapKeyRef: key: DEBUG name: env-prod + - name: DATABASE + valueFrom: + configMapKeyRef: + key: DATABASE + name: env-prod + - name: SQL_HOST + valueFrom: + configMapKeyRef: + key: SQL_HOST + name: env-prod + - name: SQL_PORT + valueFrom: + configMapKeyRef: + key: SQL_PORT + name: env-prod ports: - containerPort: 8000 protocol: TCP volumeMounts: - - mountPath: /app/reymota/mediafiles + - mountPath: /app/src/mediafiles name: reymota-media - - - mountPath: /app/reymota/lyrics/migrations + - mountPath: /app/src/lyrics/migrations name: reymota-lyrics-migrations - - mountPath: /app/reymota/repostajes/migrations + - mountPath: /app/src/repostajes/migrations name: reymota-repostajes-migrations - - mountPath: /app/reymota/reymotausers/migrations + - mountPath: /app/src/reymotausers/migrations name: reymota-reymotausers-migrations - - mountPath: /app/reymota/staticfiles + - mountPath: /app/src/staticfiles name: static-volume imagePullSecrets: - name: myregistrykey