Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
@@ -27,19 +27,19 @@ COPY --chown=appuser:appuser README.md ./
|
|
27 |
# Switch to non-root user
|
28 |
USER appuser
|
29 |
|
30 |
-
# Install dependencies
|
31 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
32 |
RUN pip install --no-cache-dir --upgrade pip && \
|
33 |
pip install --no-cache-dir --verbose torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
|
34 |
pip install --no-cache-dir -r requirements.txt && \
|
35 |
pip install --no-cache-dir uvicorn
|
36 |
|
37 |
-
# Expose
|
38 |
EXPOSE 7860
|
39 |
|
40 |
-
# Healthcheck
|
41 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
42 |
-
CMD curl --fail http://localhost
|
43 |
|
44 |
-
# Start
|
45 |
-
CMD
|
|
|
27 |
# Switch to non-root user
|
28 |
USER appuser
|
29 |
|
30 |
+
# Install dependencies
|
31 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
32 |
RUN pip install --no-cache-dir --upgrade pip && \
|
33 |
pip install --no-cache-dir --verbose torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
|
34 |
pip install --no-cache-dir -r requirements.txt && \
|
35 |
pip install --no-cache-dir uvicorn
|
36 |
|
37 |
+
# Expose default dev port
|
38 |
EXPOSE 7860
|
39 |
|
40 |
+
# Healthcheck
|
41 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
42 |
+
CMD curl --fail http://localhost:${PORT:-7860} || exit 1
|
43 |
|
44 |
+
# Start app (use HF-provided PORT if set)
|
45 |
+
CMD uvicorn app.app:app --host 0.0.0.0 --port ${PORT:-7860}
|