feat: setup inicial docker swarm stack

This commit is contained in:
Gabriel Bezerra 2026-04-30 21:14:14 +00:00
commit f13e3a9076
2 changed files with 74 additions and 0 deletions

49
docker-stack.yml Normal file
View File

@ -0,0 +1,49 @@
version: "3.9"
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- /opt/infra/nginx/conf.d:/etc/nginx/conf.d:ro
deploy:
replicas: 1
restart_policy:
condition: on-failure
update_config:
order: start-first
networks:
- app-net
modumfiscal-front:
image: gabriel18lb/modumfiscal-front:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
update_config:
parallelism: 1
delay: 10s
order: start-first
networks:
- app-net
modumfiscal-api:
image: gabriel18lb/modumfiscal-api:latest
deploy:
replicas: 2
restart_policy:
condition: on-failure
delay: 200s
max_attempts: 3
update_config:
parallelism: 1
delay: 15s
order: start-first
networks:
- app-net
networks:
app-net:
external: true

View File

@ -0,0 +1,25 @@
upstream core_api {
server app_modumfiscal-api.app-net:8090;
}
server {
listen 80;
listen [::]:80;
server_name modumfiscal.com.br www.modumfiscal.com.br;
location /api/ {
proxy_pass http://core_api;
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;
}
location / {
proxy_pass http://app_modumfiscal-front.app-net:80;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}