Update Dockerfile
Browse files- Dockerfile +9 -43
Dockerfile
CHANGED
|
@@ -1,52 +1,18 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
-
# Stage 1: Build frontend
|
| 4 |
-
FROM node:20-alpine AS frontend-builder
|
| 5 |
-
|
| 6 |
-
# Install pnpm
|
| 7 |
-
RUN corepack enable && corepack prepare pnpm@latest --activate
|
| 8 |
-
|
| 9 |
-
WORKDIR /app/front
|
| 10 |
-
|
| 11 |
-
# Copy frontend package files
|
| 12 |
-
COPY front/package.json front/pnpm-lock.yaml ./
|
| 13 |
-
|
| 14 |
-
# Install dependencies
|
| 15 |
-
RUN pnpm install --frozen-lockfile
|
| 16 |
-
|
| 17 |
-
# Copy frontend source
|
| 18 |
-
COPY front/ ./
|
| 19 |
-
|
| 20 |
-
# Build frontend
|
| 21 |
-
RUN pnpm run build
|
| 22 |
-
|
| 23 |
-
# Stage 2: Build Python application
|
| 24 |
-
FROM python:3.11-slim AS app
|
| 25 |
|
| 26 |
WORKDIR /app
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
# Install Python dependencies
|
| 32 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 33 |
-
|
| 34 |
-
# Copy application code
|
| 35 |
-
COPY app/ ./app/
|
| 36 |
-
|
| 37 |
-
# Copy built frontend from previous stage
|
| 38 |
-
COPY --from=frontend-builder /app/front/dist ./app/static
|
| 39 |
-
|
| 40 |
-
# Create data directory
|
| 41 |
-
RUN mkdir -p /data
|
| 42 |
|
| 43 |
# Environment variables
|
| 44 |
-
ENV
|
| 45 |
ENV HOST=0.0.0.0
|
| 46 |
-
ENV PORT=${PORT:-
|
| 47 |
|
| 48 |
# Expose port
|
| 49 |
-
EXPOSE ${PORT:-
|
| 50 |
|
| 51 |
-
# Run the application
|
| 52 |
-
CMD ["
|
|
|
|
| 1 |
+
# Simplified Dockerfile for Clove - For Huggingface Spaces
|
| 2 |
+
FROM python:3.11-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Install clove-proxy from PyPI
|
| 7 |
+
RUN pip install --no-cache-dir "clove-proxy[rnet]"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Environment variables
|
| 10 |
+
ENV NO_FILESYSTEM_MODE=true
|
| 11 |
ENV HOST=0.0.0.0
|
| 12 |
+
ENV PORT=${PORT:-7860}
|
| 13 |
|
| 14 |
# Expose port
|
| 15 |
+
EXPOSE ${PORT:-7860}
|
| 16 |
|
| 17 |
+
# Run the application using the installed script
|
| 18 |
+
CMD ["clove"]
|