diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a895fb4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +# Dependencies +node_modules +npm-debug.log* + +# Git +.git +.gitignore + +# Docker +Dockerfile +.dockerignore + +# Development files +*.log +.env +.env.local + +# OS generated files +.DS_Store +Thumbs.db + +# IDE files +.vscode/ +.idea/ +*.swp +*.swo + +# Cache directories +.npm +.cache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e91cee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use Node.js official image +FROM node:lts-alpine + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm ci --only=production + +# Copy application files +COPY . . + +# Expose port +EXPOSE 3000 + +# Start the application +CMD ["npm", "start"] diff --git a/README.md b/README.md index d07070f..4f8e3f6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,18 @@ An intelligent automation bot for the zyBooks learning platform. Automatically c ## Quick Start +### Option 1: Docker (Recommended) + +**Prerequisites:** Docker and Docker Compose + +```bash +git clone https://git.qzydustin.com/qzydustin/zyBooksBot +cd zyBooksBot +docker-compose up -d +``` + +### Option 2: Local Development + **Prerequisites:** Node.js (v14+) ```bash @@ -31,11 +43,28 @@ Open http://localhost:3000 in your browser. 3. Use checkboxes for batch selection 4. Execute and monitor real-time progress +## Docker Commands + +```bash +# Start the application +docker-compose up -d + +# View logs +docker-compose logs -f + +# Stop the application +docker-compose down + +# Rebuild after code changes +docker-compose up --build -d +``` + ## Technical Details **Stack:** Node.js, Express.js, JavaScript **Communication:** HTTP API with Server-Sent Events -**Key Features:** Real-time streaming, frontend state management +**Key Features:** Real-time streaming, frontend state management +**Deployment:** Docker containerized with health checks ## Important Notes diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..f437388 --- /dev/null +++ b/compose.yml @@ -0,0 +1,7 @@ +services: + zybook-auto: + build: . + ports: + - "3000:3000" + restart: unless-stopped +