Perdida de Hosts al momento de desplegar en producción #7

Closed
opened 2024-06-12 10:26:16 -05:00 by Rodia · 2 comments
Owner

Perdida constante del hosts 192.168.20.20 en archivo /etc/hosts. Determinar si es un problema en el despliegue, ¿Cómo heredar los DNS del servidor a los despliegues de Docker?

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
192.168.48.4	ec5ccea733e9
192.168.20.20 mail.onecluster.org
Perdida constante del hosts 192.168.20.20 en archivo /etc/hosts. Determinar si es un problema en el despliegue, ¿Cómo heredar los DNS del servidor a los despliegues de Docker? ``` 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 192.168.48.4 ec5ccea733e9 192.168.20.20 mail.onecluster.org ```
Rodia added the
Kind/Bug
Complexity
medium
Deployment
Tool
Priority
Medium
labels 2024-06-12 10:26:39 -05:00
Author
Owner

copiar al docker el archo ./hosts

version: '3'
services:
  db:
    image: postgres
    hostname:
     ${DB_HOSTNAME}
    volumes:
     - postgres:/var/lib/postgresql/data 
    environment:
      TZ: America/Bogota
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
  tryton:
    build:
     context: ./
     dockerfile: Dockerfile
     args:
      TRYTOND_VERSION: ${TRYTOND_VERSION}
      PYTHON_VERSION: ${PYTHON_VERSION}
      Provider: ${Provider}
      URL_MULTI_MIGRATE: ${URL_MULTI_MIGRATE}
      REPO_MULTI_MIGRATE: ${REPO_MULTI_MIGRATE}
      GITEA_DOMAIN: ${GITEA_DOMAIN}
      GITEA_USER: ${GITEA_USER}
      GITEA_PASSWORD: ${GITEA_PASSWORD}
      GITEA_ACCESS_TOKEN: ${GITEA_ACCESS_TOKEN}
      DIR_MODULES: ${DIR_MODULES}
      WORKER: ${WORKER}
      TRYTONPASSFILE: ${TRYTONPASSFILE}
      SMTP: ${SMTP}
      SMTP_TYPE: ${SMTP_TYPE}
      SMTP_USER: ${SMTP_USER}
      SMTP_PASSWORD: ${SMTP_PASSWORD}
      SMTP_DOMAIN: ${SMTP_DOMAIN}
      SMTP_PORT: ${SMTP_PORT}
      SMTP_FROM: ${SMTP_FROM}
      SMTP_EMAIL: ${SMTP_EMAIL}
    image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
    environment:
      - TZ=America/Bogota
    ports:
     - "${TRYTON_PORT:-8000}:8000"
    volumes:     
     - modules:${DIR_MODULES}
     - var:/var
     - attachment:/mnt/attachment
     - ./hosts:/etc/hosts
    depends_on:
     - db
    env_file:
     - .env
  nginx:
    image: nginx:1.23.3
    environment:
      - TZ=America/Bogota 
    restart: unless-stopped
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
    ports:
      - "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
    env_file:
      - .env
    depends_on:
      - tryton
    command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
  worker:
    image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
    environment:
      - TZ=America/Bogota
    depends_on:
     - db
     - tryton
    volumes:
     - modules:${DIR_MODULES}
     - ./hosts:/etc/hosts
    entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"]
    env_file:
     - .env
  cron:
    image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
    environment:
      - TZ=America/Bogota
    depends_on:
     - db
     - tryton
    volumes:
     - modules:${DIR_MODULES}
     - ./hosts:/etc/hosts
    entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"]
    env_file:
      - .env
  http:
      image: nginx
      environment:
        - TZ=America/Bogota
      ports:
        - "${HTTP_PORT:-80}:80"
      volumes:
        - http:/usr/share/nginx/html
  app:
    image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
    environment:
      - TZ=America/Bogota
    ports:
      - "${APP_PORT:-8010}:8010"
    volumes:
      - modules:${DIR_MODULES}
      - app:/app        
    depends_on:
      - db
      - tryton
    env_file:
      - .env
volumes:
 modules:
 var:
 postgres:
 attachment:
 http:
 app:
copiar al docker el archo ./hosts ``` version: '3' services: db: image: postgres hostname: ${DB_HOSTNAME} volumes: - postgres:/var/lib/postgresql/data environment: TZ: America/Bogota POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} tryton: build: context: ./ dockerfile: Dockerfile args: TRYTOND_VERSION: ${TRYTOND_VERSION} PYTHON_VERSION: ${PYTHON_VERSION} Provider: ${Provider} URL_MULTI_MIGRATE: ${URL_MULTI_MIGRATE} REPO_MULTI_MIGRATE: ${REPO_MULTI_MIGRATE} GITEA_DOMAIN: ${GITEA_DOMAIN} GITEA_USER: ${GITEA_USER} GITEA_PASSWORD: ${GITEA_PASSWORD} GITEA_ACCESS_TOKEN: ${GITEA_ACCESS_TOKEN} DIR_MODULES: ${DIR_MODULES} WORKER: ${WORKER} TRYTONPASSFILE: ${TRYTONPASSFILE} SMTP: ${SMTP} SMTP_TYPE: ${SMTP_TYPE} SMTP_USER: ${SMTP_USER} SMTP_PASSWORD: ${SMTP_PASSWORD} SMTP_DOMAIN: ${SMTP_DOMAIN} SMTP_PORT: ${SMTP_PORT} SMTP_FROM: ${SMTP_FROM} SMTP_EMAIL: ${SMTP_EMAIL} image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} environment: - TZ=America/Bogota ports: - "${TRYTON_PORT:-8000}:8000" volumes: - modules:${DIR_MODULES} - var:/var - attachment:/mnt/attachment - ./hosts:/etc/hosts depends_on: - db env_file: - .env nginx: image: nginx:1.23.3 environment: - TZ=America/Bogota restart: unless-stopped volumes: - ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template ports: - "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}" env_file: - .env depends_on: - tryton command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" worker: image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} environment: - TZ=America/Bogota depends_on: - db - tryton volumes: - modules:${DIR_MODULES} - ./hosts:/etc/hosts entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"] env_file: - .env cron: image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} environment: - TZ=America/Bogota depends_on: - db - tryton volumes: - modules:${DIR_MODULES} - ./hosts:/etc/hosts entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"] env_file: - .env http: image: nginx environment: - TZ=America/Bogota ports: - "${HTTP_PORT:-80}:80" volumes: - http:/usr/share/nginx/html app: image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} environment: - TZ=America/Bogota ports: - "${APP_PORT:-8010}:8010" volumes: - modules:${DIR_MODULES} - app:/app depends_on: - db - tryton env_file: - .env volumes: modules: var: postgres: attachment: http: app: ```
Author
Owner

Archivo Hosts

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
192.168.48.7	dd236594c3a1
192.168.20.20 mail.onecluster.org
Archivo Hosts ``` 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 192.168.48.7 dd236594c3a1 192.168.20.20 mail.onecluster.org ```
Rodia closed this issue 2024-07-23 15:40:48 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: OneTeam/oc-develop_oneteam#7
No description provided.