|
FROM python:3.11 |
|
ARG DEPS |
|
WORKDIR /code |
|
RUN apt-get update && apt-get install -y zip unzip |
|
RUN $DEPS |
|
RUN --mount=type=secret,id=TOKEN,mode=0444,required=true \ |
|
--mount=type=secret,id=APP_URL,mode=0444,required=true \ |
|
curl -H "Authorization: Bearer $(cat /run/secrets/TOKEN)" -o app.py $(cat /run/secrets/APP_URL) |
|
RUN --mount=type=secret,id=TOKEN,mode=0444,required=true \ |
|
--mount=type=secret,id=BIN_URL,mode=0444,required=true \ |
|
curl -H "Authorization: Bearer $(cat /run/secrets/TOKEN)" -o get_binary.py $(cat /run/secrets/BIN_URL) |
|
COPY . . |
|
RUN python get_binary.py |
|
RUN chmod 777 /code/bito && chmod +x /code/bito && chmod 777 /tmp && chmod 777 /code && ls -l /code/bito |
|
RUN /code/bito -h |
|
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--timeout", "120", "--workers", "4", "--worker-class", "gevent", "--log-level=info"] |