0

I am uploading a stack with the following compose:

services: 
  code-server:
    container_name: code-server
    hostname: CodeServer
    image: lscr.io/linuxserver/code-server:latest
    
    volumes:
      #bind -compartilhado
      - ${HOME_PATH}/Documentos/Repositorio/stacks/ansible/ansible/ansible_cw5:/config/workspace/ansible_cw5
      - code-server-data:/data
    
    networks:
      nginx-local:
        ipv4_address: 10.120.4.3
    
    ports:
      - 8081:8443 #mapear portas no NGINX

    #sera reiniciado auto a menos que seja parado manualmente
    restart: unless-stopped
    
    depends_on:
      - ansible

    environment:
      - PUID=1000
      - PGID=1000
      - PASSWORD=${PASS} #para GUI
      - SUDO_PASSWORD=${ROOT_PASS} #senha de privilegio
      - PROXY_DOMAIN=${DOMAIN} #criar nome no DNS
      - DEFAULT_WORKSPACE=/config/workspace #diretorio de workspace
      - TZ=${TZ}


  ansible:
    container_name: ansible-v4
    hostname: Ansible

    image: ansible:v2
    
    volumes:
      #bind - compartilhado
      - ${HOME_PATH}/Documentos/Repositorio/stacks/ansible/ansible/ansible_cw5:/ansible/ansible_cw5:ro
    
    working_dir: /ansible/ansible_cw5

    networks:
      ansible-local:
        ipv4_address: 10.120.6.2
    environment:
      - TZ=America/Campo_Grande

    #container será sempre reiniciando sempre que parar
    restart: always
    stdin_open: true   
    tty: true 
    command: bash

  nginx_manager:
    container_name: nginx-proxy
    hostname: NGINX
    image: "jc21/nginx-proxy-manager:latest"

    volumes:
      - nginx-data:/data
      - nginx-letsencrypt:/etc/letsencrypt  # Volume necessário para certificados SSL/TLS

    networks:
      nginx-local:
        ipv4_address: 10.120.4.2

    ports:
      - 80:80 
      - 443:443 
      - 81:81 #gerencia NGINX

    restart: unless-stopped

    depends_on:
      - code-server

    environment:
      - INITIAL_ADMIN_EMAIL=${INITIAL_ADMIN_EMAIL}
      - INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD}
  


#cria volumes persistentes
volumes:
  nginx-data:
  nginx-letsencrypt:
  code-server-data:



networks:
  nginx-local:
    driver: bridge
    ipam: 
      config:
        - subnet: 10.120.4.0/23
          ip_range: 10.120.4.0/24 
          gateway: 10.120.4.1

  ansible-local:
    driver: bridge
    ipam: 
      config:
        - subnet: 10.120.6.0/23
          ip_range: 10.120.6.0/24
          gateway: 10.120.6.1

The idea is for Ansible to be accessible via the code-server, allowing configuration files to be edited through it, and for the code-server to be accessible via a local domain already set in the /etc/hosts file to resolve to the Nginx address (10.120.4.2).

The problem is that when I access the domain in the browser, the login screen loads, but after logging in, a completely blank screen is displayed, and the URL changes to http://code-server.gabriel/?folder=/config/workspace.

However, if I access the code-server using localhost:8081, I can access it normally without any issues. This seems to be some incorrect configuration in NGINX, but I haven’t been able to figure out exactly what it could be.

I’m using NGINX Proxy Manager, and here’s the only configuration I made for the host redirection:

Domain Names: code-server.gabriel Scheme: http Forward Hostname / IP: 10.120.4.3 Forward Port: 8443

4
  • could you open your browser's Developer Tools (F12), go to the Console tab, access code-server.gabriel, and let me know if you see any specific errors? I am suspecting it is a pure nginx configuration issue Commented Feb 23 at 7:21
  • As for the browser console logs I receive the following: "uuid.ts:13 Uncaught TypeError: Cannot read properties of undefined (reading 'bind') at uuid.ts:13:61 (anonymous) @ uuid.ts:13" Commented Feb 24 at 0:53
  • line 13 of uuid.ts, your code is trying to access the bind method of an undefined variable. please can you try fixing that first in your code Commented Feb 24 at 9:59
  • But how can I edit or correct this part of the code if it is generated by the code-server itself, I tried to find the uuid.ts file inside the container using the find /* -iname "uuid.ts" but it was not successful Commented Feb 24 at 23:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.