Dockerfile 498 B

12345678910111213141516171819202122
  1. FROM python:3.9
  2. ARG G4F_API_KEY
  3. ARG G4F_IGNORED_PROVIDERS
  4. RUN useradd -m -u 1000 user
  5. WORKDIR /app
  6. COPY --chown=user ./requirements.txt requirements.txt
  7. RUN pip install --no-cache-dir --upgrade -r requirements.txt
  8. COPY --chown=user . /app
  9. USER user
  10. ENV HOME=/home/user \
  11. PATH=/home/user/.local/bin:$PATH
  12. ENV G4F_API_KEY $G4F_API_KEY
  13. ENV G4F_IGNORED_PROVIDERS $G4F_IGNORED_PROVIDERS
  14. CMD python -m g4f --port 7860 --debug --g4f-api-key $G4F_API_KEY --ignored-providers $G4F_IGNORED_PROVIDERS