Commit ·
440d5fd
1
Parent(s): a86f101
runtime model download
Browse files- Dockerfile +4 -4
- entrypoint.sh +8 -0
Dockerfile
CHANGED
|
@@ -6,13 +6,13 @@ COPY smishing_detector/requirements.txt .
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt && pip install gunicorn huggingface_hub
|
| 7 |
|
| 8 |
COPY smishing_detector/ ./smishing_detector/
|
| 9 |
-
RUN python -c "from huggingface_hub import hf_hub_download; \
|
| 10 |
-
hf_hub_download(repo_id='ExistedYear/scamshield_ai', filename='best_model.pt', \
|
| 11 |
-
local_dir='/app/smishing_detector', local_dir_use_symlinks=False)"
|
| 12 |
|
| 13 |
WORKDIR /app/smishing_detector
|
| 14 |
ENV SCAMSHIELD_DEBUG=false
|
| 15 |
ENV SCAMSHIELD_HOST=0.0.0.0
|
| 16 |
ENV SCAMSHIELD_PORT=7860
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt && pip install gunicorn huggingface_hub
|
| 7 |
|
| 8 |
COPY smishing_detector/ ./smishing_detector/
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
WORKDIR /app/smishing_detector
|
| 11 |
ENV SCAMSHIELD_DEBUG=false
|
| 12 |
ENV SCAMSHIELD_HOST=0.0.0.0
|
| 13 |
ENV SCAMSHIELD_PORT=7860
|
| 14 |
|
| 15 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
| 16 |
+
RUN chmod +x /app/entrypoint.sh
|
| 17 |
+
|
| 18 |
+
CMD ["/app/entrypoint.sh"]
|
entrypoint.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
python -c "from huggingface_hub import hf_hub_download; \
|
| 5 |
+
hf_hub_download(repo_id='ExistedYear/scamshield_ai', filename='best_model.pt', \
|
| 6 |
+
local_dir='/app/smishing_detector', local_dir_use_symlinks=False)"
|
| 7 |
+
|
| 8 |
+
exec gunicorn -w 1 -b 0.0.0.0:7860 --timeout 120 app.flask_api:app
|