diff --git a/Dockerfile b/Dockerfile index 511a6a2..4bd9a00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,14 +35,13 @@ FROM python:3.11.4-slim-buster # create directory for the app user -RUN mkdir -p /app +ENV APP_HOME=/app +RUN mkdir -p $APP_HOME/gestion_reservas/staticfiles # create the app user -#RUN addgroup --system app && adduser --system --group app +RUN addgroup --system app && adduser --system --group app # create the appropriate directories -ENV APP_HOME=/app -RUN mkdir -p $APP_HOME WORKDIR $APP_HOME # install system dependencies @@ -56,15 +55,14 @@ RUN pip install --no-cache /wheels/* # copy entrypoint.sh COPY ./entrypoint.sh . - # copy project COPY . $APP_HOME # chown all the files to the app user -#RUN chown -R app:app $APP_HOME +RUN chown -R app:app $APP_HOME # change to the app user -#USER app +USER app WORKDIR $APP_HOME/gestion_reservas # run entrypoint.sh diff --git a/K8S/db-deployment.yaml b/K8S/db-deployment.yaml index eba7712..15a2353 100644 --- a/K8S/db-deployment.yaml +++ b/K8S/db-deployment.yaml @@ -9,6 +9,8 @@ metadata: name: db namespace: jugaralpadel spec: + securityContext: + fsGroup: GROUP_ID replicas: 1 selector: matchLabels: @@ -43,7 +45,7 @@ spec: image: postgres:15 name: db volumeMounts: - - mountPath: /var/lib/postgresql/data + - mountPath: /var/lib/postgresql/data:z name: postgres-data restartPolicy: Always volumes: diff --git a/K8S/jugaralpadel-prod-persistentvolumeclaim.yaml b/K8S/jugaralpadel-prod-persistentvolumeclaim.yaml index d8c2c1a..5b6d11e 100644 --- a/K8S/jugaralpadel-prod-persistentvolumeclaim.yaml +++ b/K8S/jugaralpadel-prod-persistentvolumeclaim.yaml @@ -12,6 +12,7 @@ spec: resources: requests: storage: 100Mi + storageClassName: lvms-vg1 status: {} --- apiVersion: v1 @@ -28,6 +29,7 @@ spec: resources: requests: storage: 50Mi + storageClassName: lvms-vg1 status: {} --- apiVersion: v1 @@ -44,4 +46,5 @@ spec: resources: requests: storage: 53Mi + storageClassName: lvms-vg1 status: {} diff --git a/K8S/postgres-data-persistentvolumeclaim.yaml b/K8S/postgres-data-persistentvolumeclaim.yaml index c1576e0..8d4c5ca 100644 --- a/K8S/postgres-data-persistentvolumeclaim.yaml +++ b/K8S/postgres-data-persistentvolumeclaim.yaml @@ -11,3 +11,4 @@ spec: resources: requests: storage: 100Mi + storageClassName: lvms-vg1 diff --git a/K8S/static-volume-persistentvolumeclaim.yaml b/K8S/static-volume-persistentvolumeclaim.yaml index 85c1fb7..3779636 100644 --- a/K8S/static-volume-persistentvolumeclaim.yaml +++ b/K8S/static-volume-persistentvolumeclaim.yaml @@ -11,3 +11,4 @@ spec: resources: requests: storage: 70Mi + storageClassName: lvms-vg1 diff --git a/Makefile b/Makefile deleted file mode 100644 index 41e19a2..0000000 --- a/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -install: - - echo "Creando imagen con version '${IMG_VERSION}' para la arquitectura '${ARQUITECTURA}' en el registry '${REGISTRY}'" - - docker build --no-cache -t ${REGISTRY}/jugaralpadel-${ARQUITECTURA}:${IMG_VERSION} . - docker push ${REGISTRY}/jugaralpadel-${ARQUITECTURA}:${IMG_VERSION} - - diff --git a/gestion_reservas/gestion_reservas/settings.py b/gestion_reservas/gestion_reservas/settings.py index 85c5668..a5b3df0 100644 --- a/gestion_reservas/gestion_reservas/settings.py +++ b/gestion_reservas/gestion_reservas/settings.py @@ -94,7 +94,6 @@ DATABASES = { } } - # Password validation # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators