Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
5943eba
1
Parent(s): a3c4af6
Claude Code: optimize Dockerfile for cold start - combine COPY layers, remove uvicorn extras
Browse files- Dockerfile +4 -7
- requirements.txt +1 -1
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Minimal Python Dockerfile for Cain -
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
# Build metadata
|
|
@@ -8,16 +8,13 @@ LABEL port="7860"
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
|
|
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
|
| 15 |
-
COPY error_handlers.py .
|
| 16 |
-
COPY openclaw.json .
|
| 17 |
-
COPY openclaw/.openclaw /app/openclaw
|
| 18 |
COPY static/ /app/static/
|
| 19 |
-
|
| 20 |
-
# Create logs directory
|
| 21 |
RUN mkdir -p /app/logs
|
| 22 |
|
| 23 |
ENV PORT=7860
|
|
|
|
| 1 |
+
# Minimal Python Dockerfile for Cain - fast cold start
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
# Build metadata
|
|
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Copy requirements and install (layer cache optimization)
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy all application files in one layer
|
| 16 |
+
COPY app.py error_handlers.py openclaw.json openclaw/.openclaw /app/
|
|
|
|
|
|
|
| 17 |
COPY static/ /app/static/
|
|
|
|
|
|
|
| 18 |
RUN mkdir -p /app/logs
|
| 19 |
|
| 20 |
ENV PORT=7860
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
fastapi>=0.104.0
|
| 2 |
-
uvicorn
|
| 3 |
huggingface_hub>=0.24.5
|
| 4 |
psutil>=5.9.0
|
| 5 |
python-json-logger>=2.0.7
|
|
|
|
| 1 |
fastapi>=0.104.0
|
| 2 |
+
uvicorn>=0.24.0
|
| 3 |
huggingface_hub>=0.24.5
|
| 4 |
psutil>=5.9.0
|
| 5 |
python-json-logger>=2.0.7
|