MotagerAI / Dockerfile
Robaa's picture
Improve API key retrieval logic in Dockerfile for better handling of existing remote
652c2cf
raw
history blame
508 Bytes
FROM python:3.9
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONPATH="/app/src"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
RUN --mount=type=secret,id=APIKey,mode=0444,required=true \
git init && \
(git remote get-url origin || git remote add origin $(cat /run/secrets/APIKey))
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]