File size: 858 Bytes
29c0b7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d5a09b5
 
085c4b4
29c0b7d
085c4b4
29c0b7d
085c4b4
 
 
29c0b7d
 
 
d5a09b5
 
 
7cc8fe7
d5a09b5
29c0b7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.13-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    SERVER_HOST=0.0.0.0 \
    SERVER_PORT=8000 \
    SERVER_WORKERS=1 \
    LOG_FILE_ENABLED=false \
    DATA_DIR=/app/grok2api/data \
    LOG_DIR=/app/grok2api/logs

ARG SOURCE_REPO=https://github.com/CountClaw/grok2api-hf.git
ARG SOURCE_REF=main

RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    git \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user

WORKDIR /app

RUN git clone --depth 1 --branch ${SOURCE_REF} ${SOURCE_REPO} /app/grok2api

COPY sync_run.py /app/sync_run.py

RUN python -m pip install --upgrade pip \
    && python -m pip install -r /app/grok2api/requirements.txt huggingface_hub \
    && chown -R user:user /app

USER user

EXPOSE 8000

CMD ["python", "/app/sync_run.py"]