From 7ae8a5013e205fd9b0c589a72843854814c8d4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Toledo?= Date: Thu, 29 Jan 2026 15:04:18 -0300 Subject: [PATCH] fix: copy .bashrc in entrypoint instead of bind mount to avoid directory error --- docker-compose.yml | 5 ++--- entrypoint.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2937167..18a592e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,8 @@ services: network_mode: host volumes: # Personalização do Shell e Scripts - - ./.bashrc:/root/.bashrc:ro - - ./.bashrc:/home/itguys/.bashrc:ro - - ./.bashrc:/etc/bash.bashrc:ro + # Montado em /opt para ser distribuído pelo entrypoint (evita erro de montagem como diretório) + - ./.bashrc:/opt/custom_bashrc:ro # Volumes para Configurações (Persistência Interna) # Um único volume para o diretório de configs do Nginx (preserva nginx.conf, conf.d e snippets) diff --git a/entrypoint.sh b/entrypoint.sh index 364a7c9..a226553 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,14 @@ # Carrega o .bashrc se existir [ -f ~/.bashrc ] && . ~/.bashrc +# Distribui o .bashrc customizado se montado +if [ -f /opt/custom_bashrc ]; then + echo "📄 Aplicando .bashrc customizado..." + cat /opt/custom_bashrc > /root/.bashrc + cat /opt/custom_bashrc > /home/itguys/.bashrc + chown itguys:itguys /home/itguys/.bashrc +fi + # Gera chaves de host SSH se não existirem ssh-keygen -A