FROM python:3.9-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    libpq-dev \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY . .

# Set environment variables for database connection
ENV DB_HOST=db
ENV DB_PORT=5432
ENV DB_NAME=musicbrainz_db
ENV DB_USER=musicbrainz
ENV DB_PASSWORD=musicbrainz

# Default command
CMD ["python3", "musicbrainz_cleaner.py"] 