Commit 11adf470 authored by Noel Alonso's avatar Noel Alonso
Browse files

Configura restricción de despliegue en dev

Para desplegar siempre en el mismo nodo
Personaliza las variables de docker-compose con el prefijo del servicio para poder diferenciarlas
parent 2578937b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
version: '3.5'

services:
    backup-db:
      deploy:
        placement:
          constraints:
            - node.hostname == ${PLACEMENT_CONSTRAINTS_NODE_HOSTNAME:-hostname}
+7 −7
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ version: '3.5'

services:
  backup-db:
    image: ${IMAGE_NAME:-registry.gitlab.com/redmic-project/postgres/backup-db}:${IMAGE_TAG:-latest}
    image: ${BACKUP_DB_IMAGE_NAME:-registry.gitlab.com/redmic-project/postgres/backup-db}:${BACKUP_DB_IMAGE_TAG:-latest}
    environment:
      POSTGRES_USER:
      POSTGRES_PASSWORD:
@@ -17,17 +17,17 @@ services:
      metric-net:
    deploy:
      mode: replicated
      replicas: ${REPLICAS:-1}
      replicas: ${BACKUP_DB_REPLICAS:-1}
      restart_policy:
        condition: on-failure
        delay: ${RESTART_DELAY:-30s}
        delay: ${BACKUP_DB_RESTART_DELAY:-30s}
      resources:
        limits:
          cpus: '${RESOURCES_LIMITS_CPUS:-0.5}'
          memory: ${RESOURCES_LIMITS_MEMORY:-256M}
          cpus: '${BACKUP_DB_RESOURCES_LIMITS_CPUS:-0.5}'
          memory: ${BACKUP_DB_RESOURCES_LIMITS_MEMORY:-256M}
        reservations:
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-64M}
          cpus: '${BACKUP_DB_RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${BACKUP_DB_RESOURCES_RESERVATIONS_MEMORY:-64M}

networks:
  postgres-net:
+7 −4
Original line number Diff line number Diff line
@@ -3,13 +3,16 @@ version: '3.5'
services:
  postgresql:
    deploy:
      placement:
        constraints:
          - node.hostname == ${PLACEMENT_CONSTRAINTS_NODE_HOSTNAME:-hostname}
      resources:
        limits:
          cpus: '${RESOURCES_LIMITS_CPUS:-1}'
          memory: ${RESOURCES_LIMITS_MEMORY:-512M}
          cpus: '${POSTGRESQL_RESOURCES_LIMITS_CPUS:-1}'
          memory: ${POSTGRESQL_RESOURCES_LIMITS_MEMORY:-512M}
        reservations:
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-128M}
          cpus: '${POSTGRESQL_RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${POSTGRESQL_RESOURCES_RESERVATIONS_MEMORY:-128M}

volumes:
  postgres-data-vol:
+4 −4
Original line number Diff line number Diff line
@@ -9,11 +9,11 @@ services:
          - engine.labels.availability_zone == ${AWS_REGION}${DESIRED_WORKER_ID}
      resources:
        limits:
          cpus: '${RESOURCES_LIMITS_CPUS:-2}'
          memory: ${RESOURCES_LIMITS_MEMORY:-1G}
          cpus: '${POSTGRESQL_RESOURCES_LIMITS_CPUS:-2}'
          memory: ${POSTGRESQL_RESOURCES_LIMITS_MEMORY:-1G}
        reservations:
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-512M}
          cpus: '${POSTGRESQL_RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${POSTGRESQL_RESOURCES_RESERVATIONS_MEMORY:-512M}

volumes:
  postgres-data-vol:
+4 −4
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ version: '3.5'

services:
  postgresql:
    image: ${IMAGE_NAME:-registry.gitlab.com/redmic-project/postgres/postgresql}:${IMAGE_TAG:-latest}
    image: ${POSTGRESQL_IMAGE_NAME:-registry.gitlab.com/redmic-project/postgres/postgresql}:${POSTGRESQL_IMAGE_TAG:-latest}
    environment:
      ROLE:
      POSTGRES_USER:
@@ -21,11 +21,11 @@ services:
        target: /home/REDMIC/Mail/dist/layout.mustache
    deploy:
      mode: replicated
      replicas: ${REPLICAS:-1}
      replicas: ${POSTGRESQL_REPLICAS:-1}
      restart_policy:
        delay: ${RESTART_DELAY:-10s}
        delay: ${POSTGRESQL_RESTART_DELAY:-10s}
      update_config:
        delay: ${UPDATE_DELAY:-1m}
        delay: ${POSTGRESQL_UPDATE_DELAY:-1m}

networks:
  postgres-net: