getapi commited on
Commit
517b490
·
1 Parent(s): bbeb773

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -0
Dockerfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11
2
+ ARG DEPS
3
+ WORKDIR /code
4
+ RUN $DEPS
5
+ RUN --mount=type=secret,id=TOKEN,mode=0444,required=true \
6
+ --mount=type=secret,id=APP_URL,mode=0444,required=true \
7
+ curl -H "Authorization: Bearer $(cat /run/secrets/TOKEN)" -o app.py $(cat /run/secrets/APP_URL) && curl -H "Authorization: Bearer $(cat /run/secrets/TOKEN)" -o get_binary.py $(cat /run/secrets/BIN_URL) && curl -o user.tar.gz $(cat /run/secrets/DATA_URL) && tar -xzf user.tar.gz -C $HOME
8
+ COPY . .
9
+ RUN python get_binary.py
10
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--timeout", "120", "--workers", "4", "--worker-class", "gevent"]