chore: initial commit
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Use Python 3.13 slim image
|
||||
FROM python:3.13-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies for Playwright
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
gnupg \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install uv
|
||||
RUN pip install uv
|
||||
|
||||
# Copy dependency files first (for better caching)
|
||||
COPY pyproject.toml .
|
||||
COPY uv.lock .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN uv sync --frozen
|
||||
|
||||
# Install Playwright browsers (heavy operation, cache this layer)
|
||||
RUN uv run playwright install chromium
|
||||
RUN uv run playwright install-deps chromium
|
||||
|
||||
# Copy application code
|
||||
COPY main.py .
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
|
||||
# Run the application
|
||||
CMD ["uv", "run", "python", "main.py"]
|
Reference in New Issue
Block a user