Celestino Rey 10 months ago
parent
commit
578953a522
7 changed files with 13 additions and 17 deletions
  1. +5
    -7
      Dockerfile
  2. +3
    -1
      K8S/db-deployment.yaml
  3. +3
    -0
      K8S/jugaralpadel-prod-persistentvolumeclaim.yaml
  4. +1
    -0
      K8S/postgres-data-persistentvolumeclaim.yaml
  5. +1
    -0
      K8S/static-volume-persistentvolumeclaim.yaml
  6. +0
    -8
      Makefile
  7. +0
    -1
      gestion_reservas/gestion_reservas/settings.py

+ 5
- 7
Dockerfile View File

@ -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


+ 3
- 1
K8S/db-deployment.yaml View File

@ -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:


+ 3
- 0
K8S/jugaralpadel-prod-persistentvolumeclaim.yaml View File

@ -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: {}

+ 1
- 0
K8S/postgres-data-persistentvolumeclaim.yaml View File

@ -11,3 +11,4 @@ spec:
resources:
requests:
storage: 100Mi
storageClassName: lvms-vg1

+ 1
- 0
K8S/static-volume-persistentvolumeclaim.yaml View File

@ -11,3 +11,4 @@ spec:
resources:
requests:
storage: 70Mi
storageClassName: lvms-vg1

+ 0
- 8
Makefile View File

@ -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}

+ 0
- 1
gestion_reservas/gestion_reservas/settings.py View File

@ -94,7 +94,6 @@ DATABASES = {
}
}
# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators


Loading…
Cancel
Save