-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 866 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (27 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.8-slim
WORKDIR /app
# Copy only necessary files
COPY requirements.txt .
COPY setup.py .
COPY README.md .
COPY dvmcp/ ./dvmcp/
COPY example_model.py .
COPY model-card.yaml .
COPY smithery.yaml .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt && \
pip install -e . && \
rm -rf /root/.cache/pip/*
# Create upload directory with proper permissions
RUN mkdir -p /app/uploads && \
chown -R nobody:nogroup /app/uploads
# Use a non-root user
USER nobody
# Default port (can be overridden by smithery.yaml)
EXPOSE 5000
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5000/api/v1/model/metadata || exit 1
# Entry point that allows for configuration via environment variables
ENTRYPOINT ["python", "-m", "flask"]
CMD ["run", "--host=0.0.0.0"]