feat: setup inicial swarm dev
This commit is contained in:
parent
2d2e14df39
commit
c674856a0a
75
dev/docker-stack.yml
Normal file
75
dev/docker-stack.yml
Normal file
@ -0,0 +1,75 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- /opt/infra/dev/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-web:
|
||||
image: git.modumsolucao.com.br/modumsolucao/modumfiscal-web:latest
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 10s
|
||||
order: start-first
|
||||
networks:
|
||||
- app-net
|
||||
|
||||
modumfiscal-api:
|
||||
image: modumfiscal-api:latest
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 200s
|
||||
max_attempts: 3
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 15s
|
||||
order: start-first
|
||||
networks:
|
||||
- app-net
|
||||
|
||||
modumfiscal-bancario:
|
||||
image: modumfiscal-integracao-bancaria:latest
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 200s
|
||||
max_attempts: 3
|
||||
update_config:
|
||||
order: start-first
|
||||
networks:
|
||||
- app-net
|
||||
|
||||
modumfiscal-nfse:
|
||||
image: modumfiscal-nfse:latest
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 200s
|
||||
max_attempts: 3
|
||||
update_config:
|
||||
order: start-first
|
||||
networks:
|
||||
- app-net
|
||||
|
||||
networks:
|
||||
app-net:
|
||||
external: true
|
||||
38
dev/nginx/conf.d/modumfiscal.conf
Normal file
38
dev/nginx/conf.d/modumfiscal.conf
Normal file
@ -0,0 +1,38 @@
|
||||
upstream core_api {
|
||||
server modumfiscal-api.app-net:8090;
|
||||
}
|
||||
|
||||
upstream frontend {
|
||||
server modumfiscal-web.app-net:80;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name sistema.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://frontend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_intercept_errors on;
|
||||
error_page 404 = @fallback;
|
||||
}
|
||||
|
||||
location @fallback {
|
||||
proxy_pass http://frontend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
rewrite ^ /index.html break;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user