feat: setup inicial docker swarm stack
This commit is contained in:
commit
f13e3a9076
49
docker-stack.yml
Normal file
49
docker-stack.yml
Normal 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
|
||||||
25
nginx/conf.d/modumfiscal.conf
Normal file
25
nginx/conf.d/modumfiscal.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user