master
Amir Hossein Moghiseh 2022-05-07 01:36:08 +04:30
parent 3c537fba27
commit d5552efdfc
12 changed files with 286 additions and 74 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
.DS_* .DS_*
password password
.DS* .DS_Store

View File

@ -8,10 +8,10 @@
src: template/nginx-server-block.j2 src: template/nginx-server-block.j2
dest: /tmp/new-nginx-server-block.{{item.server_name}}.conf dest: /tmp/new-nginx-server-block.{{item.server_name}}.conf
with_items: with_items:
- server_name: tetris.game.igarson.app - server_name: doz.game.igarson.app
server_config: "" server_config: ""
service_port: 6005 service_port: 6006
conf_file: games.conf conf_file: games.conf
- name: append /tmp/new-nginx-server-block.conf to specific conf - name: append /tmp/new-nginx-server-block.conf to specific conf
@ -19,20 +19,20 @@
cat /tmp/new-nginx-server-block.{{item.server_name}}.conf >> /etc/nginx/sites-available/{{ item.conf_file }} cat /tmp/new-nginx-server-block.{{item.server_name}}.conf >> /etc/nginx/sites-available/{{ item.conf_file }}
rm -rf /tmp/new-nginx-server-block.{{item.server_name}}.conf rm -rf /tmp/new-nginx-server-block.{{item.server_name}}.conf
with_items: with_items:
- server_name: tetris.game.igarson.app - server_name: doz.game.igarson.app
server_config: "" server_config: ""
service_port: 6005 service_port: 6006
conf_file: games.conf conf_file: games.conf
- name: encrypt all domains - name: encrypt all domains
shell: | shell: |
certbot --nginx -d {{item.server_name}} -n --redirect certbot --nginx -d {{item.server_name}} -n --redirect
with_items: with_items:
- server_name: tetris.game.igarson.app - server_name: doz.game.igarson.app
server_config: "" server_config: ""
service_port: 6005 service_port: 6006
conf_file: games.conf conf_file: games.conf
- name: Reload nginx to activate specified site - name: Reload nginx to activate specified site
service: name=nginx state=restarted service: name=nginx state=restarted
@ -41,7 +41,7 @@
cron: cron:
name: renew_certificates name: renew_certificates
special_time: weekly special_time: weekly
job: certbot renew --post-hook "systemctl reload nginx" job: certbot renew --post-hook "systemctl reload nginx"

View File

@ -1,3 +1,5 @@
{{item.service_name}}: {{item.service_name}}:
image: {{item.registry}} image: {{item.registry}}
environment: environment:

View File

@ -7,6 +7,7 @@
6003 quiz ==> must change 6003 quiz ==> must change
6023 api quiz ==> must change 6023 api quiz ==> must change
6005 tetris 6005 tetris
6006 doz
} }

18
service_list.txt 100644
View File

@ -0,0 +1,18 @@
mongoprimary:27017
mongosecondary:27017
mongoarbiter:27017
pg-0:5432
pg-1:5432
rabbitmq:5672
redismaster:6379
ls:8010
core:8080
yaus:8000
menu:80
admin:80
capitan:80
website:3000
twentyfortyeight:80
sudoku:80
tetris:80
doz:80

1
stackDev/mongo/.gitignore vendored 100644
View File

@ -0,0 +1 @@
archive.gz

View File

@ -5,20 +5,19 @@ networks:
external: true external: true
volumes: volumes:
mongoprimary-data: mongo0:
mongosecondary-data:
services: services:
mongoprimary: mongoprimary:
image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5
volumes: volumes:
- mongoprimary-data:/bitnami/mongodb - mongo0:/bitnami/mongodb
environment: environment:
- MONGODB_REPLICA_SET_MODE=primary # - MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_NAME=igrep # - MONGODB_REPLICA_SET_NAME=igrep
- MONGODB_ADVERTISED_HOSTNAME=mongoprimary - MONGODB_ADVERTISED_HOSTNAME=mongoprimary
- MONGODB_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l - MONGODB_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l
- MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica # - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica
deploy: deploy:
update_config: update_config:
parallelism: 1 parallelism: 1
@ -37,61 +36,61 @@ services:
- mother - mother
mongosecondary: # mongosecondary:
image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 # image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5
environment: # environment:
- MONGODB_REPLICA_SET_MODE=secondary # - MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_REPLICA_SET_NAME=igrep # - MONGODB_REPLICA_SET_NAME=igrep
- MONGODB_ADVERTISED_HOSTNAME=mongosecondary # - MONGODB_ADVERTISED_HOSTNAME=mongosecondary
- MONGODB_INITIAL_PRIMARY_HOST=mongoprimary # - MONGODB_INITIAL_PRIMARY_HOST=mongoprimary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 # - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l # - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l
- MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica # - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica
volumes: # volumes:
- mongosecondary-data:/bitnami/mongodb # - mongosecondary-data:/bitnami/mongodb
deploy: # deploy:
update_config: # update_config:
parallelism: 1 # parallelism: 1
delay: 10s # delay: 10s
order: start-first # order: start-first
restart_policy: # restart_policy:
condition: any # condition: any
delay: 5s # delay: 5s
max_attempts: 3 # max_attempts: 3
window: 120s # window: 120s
mode: replicated # mode: replicated
replicas: 1 # replicas: 1
ports: # ports:
- "27012:27017" # - "27012:27017"
networks: # networks:
- mother # - mother
mongoarbiter: # mongoarbiter:
image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5 # image: registry.vnfco.ir/library/bitnami/mongodb:4.4.11-debian-10-r5
environment: # environment:
- MONGODB_REPLICA_SET_MODE=arbiter # - MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_REPLICA_SET_NAME=igrep # - MONGODB_REPLICA_SET_NAME=igrep
- MONGODB_ADVERTISED_HOSTNAME=mongoarbiter # - MONGODB_ADVERTISED_HOSTNAME=mongoarbiter
- MONGODB_INITIAL_PRIMARY_HOST=mongoprimary # - MONGODB_INITIAL_PRIMARY_HOST=mongoprimary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017 # - MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l # - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=cWv1WQvWEp+LPdax9We/M6PeT7KgyTE9zKmC5y1ieqz4JtpLiVifJrQg0VHYhE6l
- MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica # - MONGODB_REPLICA_SET_KEY=keyissetforlocalreplica
deploy: # deploy:
update_config: # update_config:
parallelism: 1 # parallelism: 1
delay: 10s # delay: 10s
order: start-first # order: start-first
restart_policy: # restart_policy:
condition: any # condition: any
delay: 5s # delay: 5s
max_attempts: 3 # max_attempts: 3
window: 120s # window: 120s
mode: replicated # mode: replicated
replicas: 1 # replicas: 1
networks: # networks:
- mother # - mother

BIN
stacks/lvl2/.DS_Store vendored

Binary file not shown.

View File

@ -79,20 +79,23 @@ services:
- node.role == worker - node.role == worker
volumes: volumes:
- type: bind - type: bind
source: /volume/ig/api/storage source: /volume/ig
target: /target/storage target: /target/storage
- type: bind
source: /data/backup
target: /target/backup
- type: bind - type: bind
source: /volume/config/core/application-prod.properties source: /volume/config/core/application-prod.properties
target: /target/classes/application-prod.properties target: /target/classes/application-prod.properties
- type: bind - type: bind
source: /volume/ig/api/logs/http.log source: /volume/ig/api/logs/http.log
targer: /target/logs/http.log target: /target/logs/http.log
- type: bind - type: bind
source: /volume/ig/api/logs/error.log source: /volume/ig/api/logs/error.log
targer: /target/logs/error.log target: /target/logs/error.log
- type: bind - type: bind
source: /volume/ig/api/logs/archive source: /volume/ig/api/logs/archive
targer: /target/logs/archive target: /target/logs/archive
- type: bind - type: bind
source: /etc/localtime source: /etc/localtime
target: /etc/localtime target: /etc/localtime
@ -112,13 +115,14 @@ services:
image: registry.vnfco.ir/ig/sms:latest image: registry.vnfco.ir/ig/sms:latest
environment: environment:
- QUEUE_NAME=ig-sms - QUEUE_NAME=ig-sms
- RABBIT_URI=amqp://test:test@192.168.0.108:5672 - RABBIT_URI=amqp://igarsonAgent:muyXHzymcTYLzk3wYnIwG+UJWECKy0ViUDO+UlCmPF3XS+2kliuV0TaA0mWf6lT@rabbitmq:5672
- SMS_SERVICE_URI=https://api.kavenegar.com/v1/ - SMS_SERVICE_URI=https://api.kavenegar.com/v1/
- USERAPIKEY=3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B - USERAPIKEY=3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B
- SECRETKEY=!#u*(!@ofOAJDU31y+ - SECRETKEY=!#u*(!@ofOAJDU31y+
- LINENUMBER=2000500666 - LINENUMBER=2000500666
- VERIFICATION_SERVICE_CONTEXT_PATH=/verify/lookup.json - VERIFICATION_SERVICE_CONTEXT_PATH=/verify/lookup.json
- SMS_SERVICE_CONTEXT_PATH=/sms/lookup.json - SMS_SERVICE_CONTEXT_PATH=/sms/lookup.json
- TZ=Asia/Tehran - TZ=Asia/Tehran
deploy: deploy:
update_config: update_config:

View File

@ -0,0 +1,151 @@
version: "3.7"
networks:
mother:
external: true
# ig games stack
services:
twentyfortyeight:
image: registry.vnfco.ir/ig/game/2048:latest
environment:
- TZ=Asia/Tehran
# - NODE_ENV=production
# - REACT_APP_SIGNAL_URL=https://ls.igarson.app
# - REACT_APP_PATH_URL=/api/v1
# - REACT_APP_STORAGE_URL=https://storage.igarson.app
# - REACT_APP_SIGNAL_URL_PATH=/restauranthub
# - REACT_APP_LOG_LENGTH=20
# - REACT_APP_SOCKET_SECRET=GodProtectedKeyTools
# - REACT_APP_SECRET_KEY_GAME=6JCvBmi1ADry5Qk0bLaV+5klnAqYaVtjn+HSHG4N4pOAEl480saobylNWcudDxhvgw6q0yzVmbYH+lQIS3RmEHLXRHYAHxsdXl5MBuqU/p1oCC3SWmYke1SWHkoTUOm1f8SBZ1HucOxBHv7psqFUu5lG38P/EPiozv6/0qDU+vVFFp6v9ZTigBihLll0mU6qR14krot8+y9tOnrLDkHxw3wLvWsB4wgd9+RAY97Gzzs7ix3nAXthsT+jPWdyuENiKSuKEyHKbDqciJRBGqktgYU9XkYIfZzEm4cxhscT9jqNsUg2ml+uJdDQOps2mL5LgNetWWmcP43xPIkxAwu5oK873GV3uZOdQqYE2CBYT66+/+Yp5xzoL4+qZUUiDEpfWKm+clRlAm1Keiur
deploy:
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: any
delay: 5s
window: 120s
resources:
limits:
cpus: '0.5'
memory: 50M
replicas: 1
mode: replicated
placement:
constraints:
- node.role == worker
ports:
- 6001:80
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
networks:
- mother
sudoku:
image: registry.vnfco.ir/ig/game/sudoku:latest
environment:
- TZ=Asia/Tehran
# - NODE_ENV=production
# - REACT_APP_SIGNAL_URL=https://ls.igarson.app
# - REACT_APP_PATH_URL=/api/v1
# - REACT_APP_STORAGE_URL=https://storage.igarson.app
# - REACT_APP_SIGNAL_URL_PATH=/restauranthub
# - REACT_APP_LOG_LENGTH=20
# - REACT_APP_SOCKET_SECRET=GodProtectedKeyTools
# - REACT_APP_SECRET_KEY_GAME=6JCvBmi1ADry5Qk0bLaV+5klnAqYaVtjn+HSHG4N4pOAEl480saobylNWcudDxhvgw6q0yzVmbYH+lQIS3RmEHLXRHYAHxsdXl5MBuqU/p1oCC3SWmYke1SWHkoTUOm1f8SBZ1HucOxBHv7psqFUu5lG38P/EPiozv6/0qDU+vVFFp6v9ZTigBihLll0mU6qR14krot8+y9tOnrLDkHxw3wLvWsB4wgd9+RAY97Gzzs7ix3nAXthsT+jPWdyuENiKSuKEyHKbDqciJRBGqktgYU9XkYIfZzEm4cxhscT9jqNsUg2ml+uJdDQOps2mL5LgNetWWmcP43xPIkxAwu5oK873GV3uZOdQqYE2CBYT66+/+Yp5xzoL4+qZUUiDEpfWKm+clRlAm1Keiur
deploy:
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: any
delay: 5s
window: 120s
resources:
limits:
cpus: '0.5'
memory: 50M
replicas: 1
mode: replicated
placement:
constraints:
- node.role == worker
ports:
- 6002:80
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
networks:
- mother
tetris:
image: registry.vnfco.ir/ig/game/tetris:latest
environment:
- TZ=Asia/Tehran
deploy:
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: any
delay: 5s
window: 120s
resources:
limits:
cpus: '0.5'
memory: 50M
replicas: 1
mode: replicated
placement:
constraints:
- node.role == worker
ports:
- 6005:80
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
networks:
- mother
doz:
image: registry.vnfco.ir/ig/game/doz:latest
environment:
- TZ=Asia/Tehran
deploy:
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: any
delay: 5s
window: 120s
resources:
limits:
cpus: '0.5'
memory: 20M
replicas: 1
mode: replicated
placement:
constraints:
- node.role == worker
ports:
- 6006:80
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
networks:
- mother

View File

@ -0,0 +1,36 @@
version: "3.7"
networks:
mother:
external: true
services:
watcher:
image: registry.vnfco.ir/ig/watcher:latest
environment:
deploy:
update_config:
parallelism: 1
delay: 10s
order: start-first
restart_policy:
condition: any
delay: 5s
window: 120s
resources:
limits:
cpus: '0.1'
memory: 10M
replicas: 1
mode: replicated
placement:
constraints:
- node.role == manager
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/volume/watcher/service_list:/usr/app/src/service_list:ro"
networks:
- mother