Martinacap02 commited on
Commit
a21b3e8
·
1 Parent(s): 94dd802

Modifieddvc command

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -1
Dockerfile CHANGED
@@ -28,8 +28,25 @@ RUN uv sync --locked --no-install-project
28
  # copy the rest of the files needed for inference
29
  COPY --chown=user . .
30
 
31
- RUN uv run dvc pull
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  EXPOSE 7860
34
 
 
 
35
  CMD ["uv", "run", "uvicorn", "predicting_outcomes_in_heart_failure.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
28
  # copy the rest of the files needed for inference
29
  COPY --chown=user . .
30
 
31
+ # entrypoint
32
+ RUN printf '%s\n' \
33
+ '#!/usr/bin/env sh' \
34
+ 'set -e' \
35
+ '' \
36
+ 'echo "[entrypoint] Checking DVC metadata..."' \
37
+ 'if [ -d ".dvc" ] || [ -f "dvc.yaml" ]; then' \
38
+ ' echo "[entrypoint] Running dvc pull..."' \
39
+ ' uv run dvc pull -v' \
40
+ 'else' \
41
+ ' echo "[entrypoint] No DVC metadata found, skipping dvc pull."' \
42
+ 'fi' \
43
+ '' \
44
+ 'exec "$@"' \
45
+ > /home/user/entrypoint.sh \
46
+ && chmod +x /home/user/entrypoint.sh
47
 
48
  EXPOSE 7860
49
 
50
+ ENTRYPOINT ["/home/user/entrypoint.sh"]
51
+
52
  CMD ["uv", "run", "uvicorn", "predicting_outcomes_in_heart_failure.app.main:app", "--host", "0.0.0.0", "--port", "7860"]