Implemented Discord bot for automated stock price tracking and reporting with the following features: - Hourly PayPal (PYPL) stock price updates during NYSE market hours - Custom branding for PYPL as "Steaks Stablecoin Value" - Manual stock price queries via !stock and !price commands - Multi-provider stock API support (Yahoo Finance and Finnhub) - NYSE market hours detection with holiday awareness - Discord embed formatting with color-coded price changes - Docker containerization for consistent deployment - Comprehensive documentation and deployment guides Technical stack: - Python 3.9+ with discord.py - Finnhub API for stock price data - APScheduler for hourly automated updates - Docker support for local and Unraid deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
495 B
Docker
26 lines
495 B
Docker
# Use official Python runtime as base image
|
|
FROM python:3.11-slim
|
|
|
|
# Set working directory in container
|
|
WORKDIR /app
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Create non-root user for security
|
|
RUN useradd -m -u 1000 botuser && \
|
|
chown -R botuser:botuser /app
|
|
|
|
USER botuser
|
|
|
|
# Run the bot
|
|
CMD ["python", "bot.py"]
|