fix: copy .bashrc in entrypoint instead of bind mount to avoid directory error

This commit is contained in:
João Pedro Toledo Goncalves 2026-01-29 15:04:18 -03:00
parent c80a61a115
commit 7ae8a5013e
2 changed files with 10 additions and 3 deletions

View File

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

View File

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