Files
TwitchDropsMiner/Dockerfile
Fengqing Liu 45e0c47970 migrate to pyproject.toml following PEP 621 standard
Replace requirements.txt with modern pyproject.toml configuration to align with Python packaging best practices. All dependencies are now declared in [project] section, with optional dev dependencies (ruff, mypy) in [project.optional-dependencies].

Updated all references:
- Dockerfile: Install with `pip install .` instead of `-r requirements.txt`
- setup_env.sh: Install with `pip install -e .` for editable development mode
- README.md: Updated installation instructions in both quick start and development sections
- CLAUDE.md: Updated documentation references
- .gitignore: Added common IDE and tool directories

Installation is now: `pip install -e .` for development or `pip install .` for production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 21:50:52 +11:00

58 lines
1.8 KiB
Docker

FROM python:3
# Build arguments for metadata
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
# Labels following OCI Image Format Specification
LABEL org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.authors="rangermix" \
org.opencontainers.image.url="https://github.com/rangermix/TwitchDropsMiner" \
org.opencontainers.image.documentation="https://github.com/rangermix/TwitchDropsMiner/blob/master/README.md" \
org.opencontainers.image.source="https://github.com/rangermix/TwitchDropsMiner" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.vendor="rangermix" \
org.opencontainers.image.title="Twitch Drops Miner" \
org.opencontainers.image.description="Automated Twitch drops mining application with web-based interface"
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=8080
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Copy project metadata and install dependencies
COPY pyproject.toml .
# Install Python dependencies
RUN pip install --no-cache-dir .
# Copy application code
COPY main.py ./
COPY src/ ./src/
COPY lang/ ./lang/
COPY icons/ ./icons/
COPY web/ ./web/
# Create data directory for persistent storage
RUN mkdir -p /app/data && chmod 777 /app/data
# Expose web port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/api/status')" || exit 1
# Run the application (web GUI is now default)
CMD ["python", "main.py"]