File size: 592 Bytes
635aa5d
 
73aaeaa
635aa5d
 
 
 
 
 
 
 
 
73aaeaa
 
 
 
 
 
 
 
635aa5d
 
 
 
 
 
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
FROM python:3.12-slim

# Non-root user (Hugging Face Spaces requirement)
RUN groupadd -r appuser && useradd -r -g appuser -m appuser

WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY gemini_web2api/ ./gemini_web2api/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh \
    && chown -R appuser:appuser /app

# HF Spaces free tier requires listening on 7860.
# Local Docker: map host 8081 -> container 7860, or set PORT=8081.
ENV PORT=7860 \
    HOST=0.0.0.0 \
    PYTHONUNBUFFERED=1

EXPOSE 7860

USER appuser

CMD ["/entrypoint.sh"]