redirector-cli
Version:
Global CLI tool for managing Redirector backend services with Docker Compose
203 lines (158 loc) • 4.24 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readmeTemplate = exports.gitignoreTemplate = exports.envTemplate = exports.dockerComposeTemplate = void 0;
exports.dockerComposeTemplate = `services:
postgres:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: redirector
ports:
- "\${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
backend:
image: \${DOCKER_USERNAME:-shivarajbakale}/redirector-backend:latest
ports:
- "\${BACKEND_PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/redirector
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
`;
exports.envTemplate = `# Redirector CLI Configuration
# Generated automatically - modify as needed
BACKEND_PORT=3000
POSTGRES_PORT=5432
DOCKER_USERNAME=shivarajbakale
PROJECT_NAME=redirector
NODE_ENV=production
# Database Configuration
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=redirector
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/redirector
`;
exports.gitignoreTemplate = `# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-files dependency directory (https://github.com/pledbrook/node-files)
node_modules/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
.env.local
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Docker volumes
data/
# Redirector specific
.redirector.json
`;
exports.readmeTemplate = `# Redirector Backend
This project was initialized with \`redirector-cli\`.
## Quick Start
\`\`\`bash
# Start services
redirector start
# Check status
redirector status
# View logs
redirector logs
# Stop services
redirector stop
\`\`\`
## Available Commands
- \`redirector setup\` - Initialize project configuration
- \`redirector start\` - Start all services
- \`redirector stop\` - Stop all services
- \`redirector restart\` - Restart all services
- \`redirector reset\` - Reset all data and volumes
- \`redirector status\` - Show service status
- \`redirector logs [service]\` - View service logs
## Configuration
The project uses environment variables for configuration:
- \`BACKEND_PORT\` - Backend API port (default: 3000)
- \`POSTGRES_PORT\` - PostgreSQL port (default: 5432)
- \`DOCKER_USERNAME\` - Docker Hub username (default: shivarajbakale)
## Services
- **Backend API**: Available at http://localhost:3000
- **PostgreSQL**: Available at localhost:5432
- **Health Check**: http://localhost:3000/health
## API Endpoints
- \`GET /health\` - Health check
- \`GET /groups\` - List groups
- \`POST /groups/create\` - Create group
- \`GET /requests\` - List requests
For more information, visit: https://github.com/shivarajbakale/redirector-app
`;
//# sourceMappingURL=docker-compose.template.js.map