init
This commit is contained in:
commit
39d06135c3
29 files changed
+6840
No files matched your search
@@ -0,0 +1,109 @@
|
||||
---
|
||||
port_registry_file: "group_vars/port-registry.yml"
|
||||
|
||||
# Thông tin triển khai
|
||||
deploy_env: production # Môi trường triển khai: development hoặc production
|
||||
app_name: "App" # Tên ứng dụng (sẽ được ghi đè)
|
||||
app_port: 3000 # Port mặc định
|
||||
node_env: "{{ deploy_env }}" # NODE_ENV
|
||||
nodejs_version: "18" # Phiên bản Node.js mặc định
|
||||
framework: expressjs # Framework (sẽ được ghi đè): expressjs, nestjs, nextjs, reactjs
|
||||
|
||||
# Thông tin Git
|
||||
git_repo: "" # Repo URL (bắt buộc ghi đè)
|
||||
git_tag: "latest" # Tag/branch để checkout
|
||||
git_username: "" # Username để clone repo (nếu private)
|
||||
git_token: "" # Token để clone repo (nếu private)
|
||||
|
||||
# Thông tin triển khai
|
||||
deploy_strategy: "docker" # Phương thức triển khai (pm2, systemd, etc)
|
||||
app_base_dir: "/var/www" # Thư mục cơ sở
|
||||
app_dir: "{{ app_base_dir }}/{{ app_name }}-{{ deploy_env }}{{ env_tag }}"
|
||||
deploy_dir: "{{ app_dir }}-{{ git_tag }}"
|
||||
current_dir: "{{ app_dir }}-current"
|
||||
keep_releases: 3 # Số lượng phiên bản cần giữ lại
|
||||
|
||||
# Các lệnh ứng dụng
|
||||
app_install_cmd: "npm ci" # Lệnh cài đặt dependencies
|
||||
app_build_cmd: "npm run build" # Lệnh build ứng dụng
|
||||
app_start_cmd: "" # Lệnh khởi động ứng dụng
|
||||
app_start_cmds: # Lệnh khởi động ứng dụng theo framework
|
||||
expressjs: "./dist/main.js"
|
||||
nestjs: "./dist/main.js"
|
||||
reactjs: "serve"
|
||||
nextjs: "node_modules/next/dist/bin/next"
|
||||
app_start_args: # Tham so cho lệnh khởi động ứng dụng
|
||||
expressjs: ""
|
||||
nestjs: ""
|
||||
reactjs: "-s build"
|
||||
nextjs: "start"
|
||||
#app_start_cmd_override_worker: "./dist/cli.js sync_queue" #override start command for worker
|
||||
|
||||
# Thông tin server
|
||||
server_host: "" # Server IP/hostname (bắt buộc ghi đè)
|
||||
server_port: "22" # Server Port
|
||||
server_user: "" # Username SSH (bắt buộc ghi đè)
|
||||
server_password: "" # Password SSH (để trống nếu dùng SSH key)
|
||||
server_become_password: "" # Password sudo (để trống nếu dùng SSH key)
|
||||
ssh_key_path: "" # Đường dẫn SSH private key file (để trống nếu dùng ssh_key_content)
|
||||
ssh_key_content: "" # Nội dung SSH private key (từ GitLab CI/CD variables)
|
||||
auth_method: "password" # Phương thức xác thực: "password" hoặc "ssh_key"
|
||||
|
||||
# Environment-specific overrides
|
||||
environment_config:
|
||||
development:
|
||||
short_key: "dev"
|
||||
log_level: "debug"
|
||||
enable_swagger: true
|
||||
enable_hot_reload: true
|
||||
database_logging: true
|
||||
pm2_instances: 1
|
||||
pm2_max_memory: "1G"
|
||||
production:
|
||||
short_key: "prod"
|
||||
log_level: "warn"
|
||||
enable_swagger: false
|
||||
enable_hot_reload: false
|
||||
database_logging: false
|
||||
pm2_instances: 1
|
||||
pm2_max_memory: "2G"
|
||||
|
||||
# Path Configurations
|
||||
entities_dir: "src/api/models"
|
||||
migrations_dir: "src/database/migrations"
|
||||
seeding_factories: "src/database/factories/**/*{.ts,.js}"
|
||||
seeding_seeds: "src/database/seeds/**/*{.ts,.js}"
|
||||
controllers_dir: "/api/controllers/**/*Controller{.ts,.js}"
|
||||
cron_dir: "/api/cron-jobs/**/*Job{.ts,.js}"
|
||||
middlewares_dir: "/infrastructure/middlewares/**/*{.ts,.js}"
|
||||
subscribers_dir: "/api/subscribers/**/*Subscriber{.ts,.js}"
|
||||
events_dir: "/api/events/**/*{.ts,.js}"
|
||||
resolvers_dir: "/api/resolvers/**/*Resolver{.ts,.js}"
|
||||
|
||||
# Health Check Configuration
|
||||
health_check:
|
||||
enabled: false
|
||||
endpoint: ""
|
||||
timeout: 5000
|
||||
interval: 30000
|
||||
|
||||
# Security Configuration
|
||||
security:
|
||||
cors_origins: "*"
|
||||
helmet_enabled: true
|
||||
rate_limit_enabled: true
|
||||
request_size_limit: "50mb"
|
||||
trust_proxy: true
|
||||
|
||||
# Custom NPM Scripts
|
||||
custom_scripts:
|
||||
enabled: false
|
||||
|
||||
# Deployment Configuration
|
||||
pm2_restart_delay: 5000
|
||||
|
||||
# Auto-scaling configuration
|
||||
replicas: 1
|
||||
max_replicas: 9
|
||||
health_check_timeout: 30
|
||||
deployment_timeout: 300
|
||||
@@ -0,0 +1,11 @@
|
||||
# port-registry.yml
|
||||
projects:
|
||||
tarot-fe:
|
||||
development: 3002
|
||||
production: 3002
|
||||
staging: 13002
|
||||
|
||||
tarot-be:
|
||||
development: 3003
|
||||
production: 3003
|
||||
staging: 13003
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# default resource_limits
|
||||
resource_limits:
|
||||
development:
|
||||
memory: "2g"
|
||||
cpu: "1.0"
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# default resource_limits
|
||||
resource_limits:
|
||||
production:
|
||||
memory: "4g"
|
||||
cpu: "2.0"
|
||||
Reference in new issue
Block a user