FROM python:3.12-slim

WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir \
        "aiofiles>=25.1.0" \
        "aiohttp>=3.9.0" \
        "aiosqlite>=0.22.0" \
        "msgpack>=1.1.0" \
        "pydantic>=2.10.0" \
        "python-socks[asyncio]>=2.8.0" \
        "qrcode>=8.2" \
        "websockets>=16.0" \
        "zstandard>=0.25.0" \
    && pip install --no-cache-dir --no-deps "maxapi-python==2.3.1"
COPY src ./src

ENV PORT=3002
ENV PYMAX_SESSION_DIR=/data/pymax-session
EXPOSE 3002

CMD ["python", "-m", "src.server"]
