diff --git a/dev/docker-stack.yml b/dev/docker-stack.yml new file mode 100644 index 0000000..0bbdebd --- /dev/null +++ b/dev/docker-stack.yml @@ -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 diff --git a/dev/nginx/conf.d/modumfiscal.conf b/dev/nginx/conf.d/modumfiscal.conf new file mode 100644 index 0000000..34795ba --- /dev/null +++ b/dev/nginx/conf.d/modumfiscal.conf @@ -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; + } +}