Spaces:
Paused
Paused
Restore Dockerfile from 4bac0e2
Browse files- Dockerfile +7 -10
Dockerfile
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
-
#
|
| 2 |
FROM node:20-alpine AS frontend-builder
|
| 3 |
RUN apk add --no-cache git
|
| 4 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /source
|
| 5 |
WORKDIR /source/frontend
|
| 6 |
RUN npm install && npm run build
|
| 7 |
|
|
|
|
| 8 |
FROM python:3.12-slim
|
| 9 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
| 10 |
RUN useradd -m -u 1000 user
|
|
@@ -19,20 +20,16 @@ RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /tmp/
|
|
| 19 |
cp -r /tmp/source/configs ./configs && \
|
| 20 |
rm -rf /tmp/source
|
| 21 |
|
| 22 |
-
# Install
|
| 23 |
RUN uv sync --no-dev --frozen
|
| 24 |
|
| 25 |
-
# Copy frontend
|
| 26 |
COPY --from=frontend-builder /source/frontend/dist ./static/
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
COPY patch_agent.py /tmp/patch_agent.py
|
| 30 |
-
RUN python /tmp/patch_agent.py && echo "✅ Agent patched"
|
| 31 |
-
|
| 32 |
-
# Override main.py and config
|
| 33 |
-
COPY backend/main.py ./backend/main.py
|
| 34 |
COPY configs/frontend_agent_config.json ./configs/frontend_agent_config.json
|
| 35 |
|
|
|
|
| 36 |
RUN mkdir -p /app/session_logs && chown -R user:user /app
|
| 37 |
|
| 38 |
USER user
|
|
@@ -43,4 +40,4 @@ ENV HOME=/home/user \
|
|
| 43 |
|
| 44 |
EXPOSE 7860
|
| 45 |
WORKDIR /app/backend
|
| 46 |
-
CMD ["
|
|
|
|
| 1 |
+
# Clone and build from smolagents/ml-intern source
|
| 2 |
FROM node:20-alpine AS frontend-builder
|
| 3 |
RUN apk add --no-cache git
|
| 4 |
RUN git clone --depth 1 https://huggingface.co/spaces/smolagents/ml-intern /source
|
| 5 |
WORKDIR /source/frontend
|
| 6 |
RUN npm install && npm run build
|
| 7 |
|
| 8 |
+
# Stage 2: Production
|
| 9 |
FROM python:3.12-slim
|
| 10 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
| 11 |
RUN useradd -m -u 1000 user
|
|
|
|
| 20 |
cp -r /tmp/source/configs ./configs && \
|
| 21 |
rm -rf /tmp/source
|
| 22 |
|
| 23 |
+
# Install dependencies
|
| 24 |
RUN uv sync --no-dev --frozen
|
| 25 |
|
| 26 |
+
# Copy built frontend
|
| 27 |
COPY --from=frontend-builder /source/frontend/dist ./static/
|
| 28 |
|
| 29 |
+
# Override config to use Anthropic API directly (not AWS Bedrock)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
COPY configs/frontend_agent_config.json ./configs/frontend_agent_config.json
|
| 31 |
|
| 32 |
+
# Create directories
|
| 33 |
RUN mkdir -p /app/session_logs && chown -R user:user /app
|
| 34 |
|
| 35 |
USER user
|
|
|
|
| 40 |
|
| 41 |
EXPOSE 7860
|
| 42 |
WORKDIR /app/backend
|
| 43 |
+
CMD ["bash", "start.sh"]
|