-
-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 release: v1.0.0-beta.2 #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
2b91b56
Initial plan for issue
Copilot 23241e1
Add Dockerfile and .dockerignore for containerized deployment
Copilot a291fa6
Update README with Docker deployment instructions
Copilot 71ab6e2
Streamline .dockerignore to focus on Node.js essentials only
Copilot 65b8834
Initial plan for issue
Copilot 4b1bdd6
Add security notice to Docker section in README.md
Copilot 147c40d
Bump version to 1.0.0-beta.2 for Docker feature addition
Copilot 76e53ec
Merge pull request #23 from wgtechlabs/copilot/fix-beefc49d-d8f9-4185…
warengonzaga bad476e
Refactor Docker preinstall approach to use environment variables inst…
Copilot 4c232fd
Merge pull request #22 from wgtechlabs/copilot/fix-56e5a116-4122-4aee…
warengonzaga b7d44f5
📦 new: add docker support
warengonzaga 687bdb9
☕ chore: update redis urls in readme
warengonzaga d01d68f
☕ chore: remove docker files
warengonzaga a964225
📦 new: add docker support
warengonzaga c2ca55d
✨ tweak: refactor Docker setup and enhance documentation for Unthread…
warengonzaga 24473cf
☕ chore: update environment variables
warengonzaga ef2fa31
📦 new: add workflows and update env
warengonzaga cfd7ea8
✨ tweak: update docker-compose for server
warengonzaga 9ec4797
🐛 fix: security issues
warengonzaga 1360e34
✨ tweak: update dockerfile and dependencies
warengonzaga 995171d
✨ tweak: update node version and dependencies
warengonzaga 7c0900a
✨ tweak: enhance documentation and security measures
warengonzaga 16aa102
✨ tweak: update sbom generation script
warengonzaga fc79c45
✨ tweak: update sbom generation script
warengonzaga 5941366
✨ tweak: update sbom generation
warengonzaga 8d2c395
✨ tweak: improve sbom script checks
warengonzaga a9a8a38
✨ tweak: update sbom script dependencies
warengonzaga ffbf58b
✨ tweak: update node version
warengonzaga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Node.js | ||
node_modules/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
package-lock.json | ||
|
||
# Build output | ||
dist/ | ||
|
||
# Git | ||
.git/ | ||
.gitignore | ||
|
||
# Environment files | ||
.env | ||
.env.* | ||
!.env.example | ||
|
||
# IDE and editor files | ||
.vscode/ | ||
.idea/ | ||
*.swp | ||
*.swo | ||
*~ | ||
|
||
# OS generated files | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Logs | ||
logs/ | ||
*.log | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm/ | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# Test and validation scripts | ||
*-test.js | ||
*-validation.js | ||
|
||
# Development container | ||
.devcontainer/ | ||
|
||
# Documentation | ||
README.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
SECURITY.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Docker Compose Environment Variables | ||
# Copy this file to .env and fill in your actual values | ||
|
||
# Required - Telegram Bot Configuration | ||
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here | ||
|
||
# Required - Unthread API Configuration | ||
UNTHREAD_API_KEY=your_unthread_api_key_here | ||
UNTHREAD_CHANNEL_ID=your_unthread_channel_id_here | ||
UNTHREAD_WEBHOOK_SECRET=your_unthread_webhook_secret_here | ||
|
||
# Database Configuration | ||
POSTGRES_URL=postgresql://unthread:unthread_password@postgres:5432/unthread_bot | ||
|
||
# Redis Configuration | ||
WEBHOOK_REDIS_URL=redis://redis:6379 | ||
PLATFORM_REDIS_URL=redis://redis:6379 | ||
|
||
# Optional - Webhook Configuration | ||
WEBHOOK_POLL_INTERVAL=1000 | ||
|
||
# Optional - Company Configuration | ||
COMPANY_NAME=Unthread | ||
|
||
# Optional - Environment | ||
NODE_ENV=production | ||
|
||
# Database Internal Configuration | ||
POSTGRES_DB=unthread_bot | ||
POSTGRES_USER=unthread | ||
POSTGRES_PASSWORD=unthread_password | ||
POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Multi-stage Dockerfile for TypeScript-based Telegram Bot | ||
|
||
# Build stage | ||
FROM node:20-alpine AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package files | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install all dependencies (including devDependencies for build) | ||
# Update CA certificates for secure connections | ||
RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates | ||
RUN npm config set registry https://registry.npmjs.org/ && \ | ||
DOCKER_BUILD=true yarn install --frozen-lockfile | ||
|
||
# Copy source code | ||
COPY src/ ./src/ | ||
COPY tsconfig.json ./ | ||
|
||
# Build TypeScript | ||
RUN yarn build | ||
|
||
# Production stage | ||
FROM node:20-alpine AS production | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package files | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install only production dependencies | ||
# Update CA certificates for secure connections | ||
RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates | ||
RUN npm config set registry https://registry.npmjs.org/ && \ | ||
DOCKER_BUILD=true yarn install --frozen-lockfile --production | ||
|
||
# Copy built application from builder stage | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# Set the entrypoint | ||
CMD ["node", "dist/index.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: '3.8' | ||
|
||
services: | ||
# Unthread Telegram Bot | ||
unthread-bot: | ||
build: . | ||
container_name: unthread-telegram-bot | ||
restart: unless-stopped | ||
env_file: | ||
- .env.docker | ||
depends_on: | ||
- postgres | ||
- redis | ||
networks: | ||
- unthread-network | ||
|
||
# PostgreSQL Database | ||
postgres: | ||
image: postgres:15-alpine | ||
container_name: unthread-postgres | ||
restart: unless-stopped | ||
env_file: | ||
- .env.docker | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS} | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U unthread -d unthread_bot"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 30s | ||
networks: | ||
- unthread-network | ||
|
||
# Redis Cache (optional but recommended) | ||
redis: | ||
image: redis:7-alpine | ||
container_name: unthread-redis | ||
restart: unless-stopped | ||
command: redis-server --appendonly yes --requirepass unthread_redis_password | ||
volumes: | ||
- redis_data:/data | ||
ports: | ||
- "6379:6379" | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "-a", "unthread_redis_password", "ping"] | ||
interval: 10s | ||
timeout: 3s | ||
retries: 5 | ||
start_period: 30s | ||
networks: | ||
- unthread-network | ||
|
||
volumes: | ||
postgres_data: | ||
driver: local | ||
redis_data: | ||
driver: local | ||
|
||
networks: | ||
unthread-network: | ||
driver: bridge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "unthread-telegram-bot", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"description": "A Telegram bot integrated with Unthread API featuring enhanced logging with @wgtechlabs/log-engine", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
|
@@ -11,10 +11,10 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"preinstall": "npx only-allow yarn", | ||
"preinstall": "test \"$DOCKER_BUILD\" = \"true\" || npx only-allow yarn", | ||
"build": "tsc", | ||
"start": "node dist/index.js", | ||
"dev": "nodemon --exec 'npm run build && npm start' src/index.ts", | ||
"dev": "nodemon --exec 'yarn build && yarn start' src/index.ts", | ||
"dev:watch": "concurrently \"tsc --watch\" \"nodemon dist/index.js\"", | ||
"clean": "rm -rf dist" | ||
}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.