ajustes de inicialização, adicionado orientações de uso da API no Manager
This commit is contained in:
parent
b6e3ea8ec3
commit
b3753e768c
@ -1,8 +1,9 @@
|
||||
# Usar uma imagem oficial do Python como base
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Instalar dependências do sistema
|
||||
# Instalar dependências do sistema, incluindo redis-tools
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
redis-tools \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Definir o diretório de trabalho
|
||||
@ -22,10 +23,14 @@ RUN mkdir -p /app/static
|
||||
COPY static/ /app/static/
|
||||
|
||||
# Garantir permissões de execução ao script inicial
|
||||
COPY start.sh .
|
||||
RUN chmod +x start.sh
|
||||
|
||||
# Converter possíveis caracteres de retorno de carro do Windows
|
||||
RUN apt-get update && apt-get install -y dos2unix && dos2unix start.sh && apt-get remove -y dos2unix && apt-get autoremove -y && apt-get clean
|
||||
|
||||
# Expor as portas usadas pela aplicação
|
||||
EXPOSE 8005 8501
|
||||
|
||||
# Definir o comando inicial
|
||||
CMD ["./start.sh"]
|
||||
CMD ["/bin/bash", "/app/start.sh"]
|
8
start.sh
8
start.sh
@ -7,8 +7,16 @@ initialize_redis_config() {
|
||||
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET PROCESS_GROUP_MESSAGES "false"
|
||||
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET PROCESS_SELF_MESSAGES "true"
|
||||
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET DEBUG_MODE "false"
|
||||
redis-cli -h $REDIS_HOST -p $REDIS_PORT SET API_DOMAIN "$API_DOMAIN"
|
||||
}
|
||||
|
||||
# Aguardar o Redis estar pronto
|
||||
echo "Aguardando o Redis ficar disponível..."
|
||||
until redis-cli -h $REDIS_HOST -p $REDIS_PORT PING; do
|
||||
echo "Redis não está pronto - aguardando..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# Inicializar configurações no Redis
|
||||
initialize_redis_config
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user