- Added package.json for project dependencies and scripts. - Created redis.ts for Redis connection configuration. - Set up tsconfig.json for TypeScript compilation settings. - Implemented worker.ts to handle GitHub repository deployments using BullMQ and Octokit.
1.5 KiB
1.5 KiB
Worker Setup for Website Generator
Docker Installation
This project requires Docker to be installed on your system.
-
Install Docker: Follow the official installation guide for your operating system:
-
Post-installation steps for Linux: If you are on Linux, follow the post-installation steps to manage Docker as a non-root user.
-
Verify Installation: Run the following command to verify that Docker is installed correctly.
docker run hello-world
Deployment -
Setup environment variables
mv .env.example .env
# ------------------------------
# Redis Configuration
# ------------------------------
REDIS_URL=redis://username:your_password@HOST:PORT
# ------------------------------
# GitHub Configuration
# ------------------------------
# Scopes required: 'repo' (to create repos and push code)
GITHUB_TOKEN=ghp_xxxxxx
# The GitHub username associated with the token above
GITHUB_USERNAME=github_username
Build and run
docker compose up --build -d
or
docker-compose up --build -d
View logs
docker-compose logs -f worker
Restart worker
docker-compose restart worker
Stop worker
docker-compose down
Rebuild after code changes
docker-compose up --build -d