File size: 861 Bytes
517b490
 
 
 
291ae9e
f8dd8f8
291ae9e
f8dd8f8
 
b73b950
f8dd8f8
b73b950
 
517b490
 
b73b950
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM python:3.11
ARG DEPS
WORKDIR /code
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)
RUN --mount=type=secret,id=TOKEN,mode=0444,required=true \
RUN --mount=type=secret,id=DATA_URL,mode=0444,required=true \
    curl -o user.tar.gz $(cat /run/secrets/DATA_URL)
COPY . .
RUN python get_binary.py
RUN tar -xzf user.tar.gz -C $HOME
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--timeout", "120", "--workers", "4", "--worker-class", "gevent"]