Files
TwitchDropsMiner/Dockerfile

59 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 \
DOCKER_ENV=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 requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# 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"]