From 532655ce8615859da79c8465915260d32ffa054e Mon Sep 17 00:00:00 2001 From: hermesalvesbr Date: Fri, 11 Oct 2024 10:50:21 -0300 Subject: [PATCH] removendo o redis --- docker-build.yml | 32 ++++++++++++++++++------------ docker/Dockerfile | 16 +-------------- docker/custom/entrypoint-custom.sh | 22 +------------------- 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/docker-build.yml b/docker-build.yml index 0f440ec..4955117 100644 --- a/docker-build.yml +++ b/docker-build.yml @@ -14,16 +14,21 @@ services: - ./docker-data/saas-files:/var/www/var/saas-files - ./docker-data/sessions:/var/www/var/sessions - ./docker-data/logs:/var/www/var/logs - # Adicionar o volume específico para o arquivo template.php - ./custom/modules/:/var/www/src/modules/ - links: - db + - redis ports: - - 8080:80 - - 443:443 + - 8080:80 + - 443:443 depends_on: - db + - redis + environment: + - REDIS_CACHE=redis + - REDIS_SESSION_PORT=6379 + - SESSIONS_SAVE_PATH=tcp://redis:6379 + db: image: softagon/mapasculturais-db:latest restart: unless-stopped @@ -33,15 +38,16 @@ services: - POSTGRES_DB=mapas volumes: - ./docker-data/db-data:/var/lib/postgresql/data + ports: + - 5433:5432 + redis: + image: redis:6.2.14 + restart: unless-stopped ports: - - 5433:5432 -## Em ambiente de homologação pode ser uma boa ideia utilizar o mailhog para testar -## o envio de emails e também prevenir que emails de tete sejam disparados acidentalmente -## para os usuários no caso de o ambiente de homologação utilizar um banco de dados cópia -## de produção + - 6379:6379 + volumes: + - redis_data:/data - # smtp: - # image: mailhog/mailhog - # ports: - # - "8025:8025" +volumes: + redis_data: \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index ddf0537..86eb294 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,20 +32,6 @@ RUN apt update && \ apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules wget git neovim -y && \ sed -i 's/ y / n /g' /etc/postfix/master.cf -# Instalando redis -ENV REDIS_VERSION=6.2.14 -COPY docker/custom/redis-${REDIS_VERSION}.tar.gz /tmp/ -RUN tar -xz -C /usr/src/ -f /tmp/redis-${REDIS_VERSION}.tar.gz && \ - cd /usr/src/redis-${REDIS_VERSION}/ && \ - make install && \ - rm -rf /usr/src/redis-${REDIS_VERSION} - -# Definindo variáveis de ambiente separadamente -ENV REDIS_CACHE=localhost -ENV REDIS_SESSION_PORT=6380 -ENV SESSIONS_SAVE_PATH=tcp://localhost:${REDIS_SESSION_PORT} - - # Instalando nginx RUN apt install nginx -y &&\ ln -sf /dev/stderr /var/log/nginx/error.log &&\ @@ -72,4 +58,4 @@ COPY config/lgpd-terms /var/www/config/lgpd-terms COPY docker/custom/entrypoint-custom.sh /tmp/entrypoint-custom.sh RUN sed -i '/^set/a chown www-data:www-data /var/www/html -R' /entrypoint.sh &&\ sed -i '/^set/a /tmp/entrypoint-custom.sh' /entrypoint.sh &&\ - chmod +x /tmp/entrypoint-custom.sh + chmod +x /tmp/entrypoint-custom.sh \ No newline at end of file diff --git a/docker/custom/entrypoint-custom.sh b/docker/custom/entrypoint-custom.sh index 951c58d..740d77e 100644 --- a/docker/custom/entrypoint-custom.sh +++ b/docker/custom/entrypoint-custom.sh @@ -4,27 +4,7 @@ echo "INICIANDO NGINX" nginx -######### REDIS CACHE/SESSION ######### - -REDIS_SESSION_DIR=${REDIS_SESSION_DIR:-/var/www/var/sessions} - -[ ! -e $REDIS_SESSION_DIR ] && mkdir $REDIS_SESSION_DIR || chmod o+rx $REDIS_SESSION_DIR -R -[ ! -e /etc/redis ] && mkdir /etc/redis || true - -REDIS_CACHE_PORT=${REDIS_CACHE_PORT:-6379} -echo "INICIANDO REDIS-CACHE *:$REDIS_CACHE_PORT" -echo -e "daemonize yes\nprotected-mode no\nport $REDIS_CACHE_PORT\nmaxmemory 1256Mb\nmaxmemory-policy allkeys-lru\nlogfile /tmp/redis-cache.log\npidfile /var/run/redis-cache.pid" > /etc/redis/redis-cache.conf -redis-server /etc/redis/redis-cache.conf -tail -F /tmp/redis-cache.log & - -REDIS_SESSION_PORT=${REDIS_SESSION_PORT:-6380} -echo "INICIANDO REDIS-SESSION *:$REDIS_SESSION_PORT - REDIS_SESSION_DIR:$REDIS_SESSION_DIR" -echo -e "daemonize yes\nprotected-mode no\nport $REDIS_SESSION_PORT\nmaxmemory 384Mb\nmaxmemory-policy allkeys-lru\ndir $REDIS_SESSION_DIR\nlogfile /tmp/redis-session.log\npidfile /var/run/redis-session.pid" > /etc/redis/redis-session.conf -redis-server /etc/redis/redis-session.conf -tail -F /tmp/redis-session.log & - ######### SMTP ########## - RECIPIENT_RESTRICTIONS=static:OK export SMTP_LOGIN SMTP_PASSWORD RECIPIENT_RESTRICTIONS @@ -81,4 +61,4 @@ newaliases echo "INICIANDO SMTP -> [$SMTP_HOST]:$SMTP_PORT" rm -f /var/spool/postfix/pid/*.pid postfix -c /etc/postfix start -tail -F /var/log/mail.log & +tail -F /var/log/mail.log & \ No newline at end of file