-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (36 loc) · 990 Bytes
/
Dockerfile
File metadata and controls
48 lines (36 loc) · 990 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
36
37
38
39
40
41
42
43
44
45
46
47
48
# Multi-stage Dockerfile for QPyth Space
# Stage 1: Frontend build
FROM node:18-alpine AS frontend-builder
WORKDIR /app/web
COPY web/package*.json ./
RUN npm ci
COPY web/ ./
RUN npm run build
# Stage 2: Backend
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy Python requirements
COPY pyproject.toml ./
COPY quantumpytho/ ./quantumpytho/
COPY requirements.txt ./
# Install Python dependencies (without pyscf - use fallback VQE)
RUN pip install --no-cache-dir -e ".[web]"
RUN pip install fastapi uvicorn
# Copy built frontend
COPY --from=frontend-builder /app/web/dist /app/web/dist
# Copy Space server
COPY space_server.py ./
# Expose port 7860 for Hugging Face Spaces
EXPOSE 7860
# Environment variables
ENV PYTHONPATH=/app
ENV QPYTH_BACKEND=automatic
ENV QPYTH_SHOTS=1024
# Start the Space server
CMD ["python", "space_server.py"]