feat: adiciona portal-modumfiscal-web + Redis ao stack dev e prod
Inclui serviços portal-modumfiscal-web (Nuxt 3 SSR, porta 3000) e portal-redis (Redis 7 Alpine, AOF) em ambos os ambientes. Adiciona portal.conf no nginx com regex wildcard para subdomínios do contribuinte, excluindo app/sistema que seguem para o backoffice. Em prod, retira *.modumfiscal.com.br do modumfiscal.conf para não bloquear o regex do portal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
b7ac681e16
commit
443bc25264
@ -109,9 +109,39 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- app-net
|
- app-net
|
||||||
|
|
||||||
|
portal-modumfiscal-web:
|
||||||
|
image: git.modumsolucao.com.br/modumsolucao/portal-modumfiscal-web:latest
|
||||||
|
environment:
|
||||||
|
- NUXT_REDIS_URL=redis://portal-redis:6379
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 10s
|
||||||
|
order: start-first
|
||||||
|
networks:
|
||||||
|
- app-net
|
||||||
|
|
||||||
|
portal-redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
volumes:
|
||||||
|
- portal-redis-data:/data
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
update_config:
|
||||||
|
order: start-first
|
||||||
|
networks:
|
||||||
|
- app-net
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app-net:
|
app-net:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
rabbitmq-data:
|
rabbitmq-data:
|
||||||
|
portal-redis-data:
|
||||||
|
|||||||
22
dev/nginx/conf.d/portal.conf
Normal file
22
dev/nginx/conf.d/portal.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
upstream portal_web {
|
||||||
|
server portal-modumfiscal-web.app-net:3000;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Captura todos os subdomínios de modumfiscal.com.br exceto sistema (coberto por modumfiscal.conf)
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
listen [::]:8080;
|
||||||
|
server_name ~^(?!sistema\.)(.+)\.modumfiscal\.com\.br$;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://portal_web;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
# Necessário para SSE/streaming de resposta do Nuxt
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_read_timeout 60s;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -121,9 +121,41 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- app-net
|
- app-net
|
||||||
|
|
||||||
|
portal-modumfiscal-web:
|
||||||
|
image: git.modumsolucao.com.br/modumsolucao/portal-modumfiscal-web:prod-latest
|
||||||
|
environment:
|
||||||
|
- NUXT_REDIS_URL=redis://portal-redis:6379
|
||||||
|
deploy:
|
||||||
|
replicas: 2
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
delay: 30s
|
||||||
|
max_attempts: 3
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 15s
|
||||||
|
order: start-first
|
||||||
|
networks:
|
||||||
|
- app-net
|
||||||
|
|
||||||
|
portal-redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
volumes:
|
||||||
|
- portal-redis-data:/data
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
update_config:
|
||||||
|
order: start-first
|
||||||
|
networks:
|
||||||
|
- app-net
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app-net:
|
app-net:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
rabbitmq-data:
|
rabbitmq-data:
|
||||||
|
portal-redis-data:
|
||||||
|
|||||||
@ -9,7 +9,7 @@ upstream frontend {
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
server_name app.modumfiscal.com.br *.modumfiscal.com.br;
|
server_name app.modumfiscal.com.br sistema.modumfiscal.com.br;
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://core_api;
|
proxy_pass http://core_api;
|
||||||
|
|||||||
23
prod/nginx/conf.d/portal.conf
Normal file
23
prod/nginx/conf.d/portal.conf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
upstream portal_web {
|
||||||
|
server portal-modumfiscal-web.app-net:3000;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Captura todos os subdomínios de modumfiscal.com.br destinados ao portal do contribuinte.
|
||||||
|
# O nginx resolve server_name mais específico primeiro: app/sistema.modumfiscal.com.br
|
||||||
|
# (em modumfiscal.conf) tem prioridade; os demais subdomínios caem aqui.
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name ~^(?!app\.|sistema\.)(.+)\.modumfiscal\.com\.br$;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://portal_web;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_read_timeout 60s;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user