-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.quantum
More file actions
107 lines (86 loc) · 2.34 KB
/
Copy pathDockerfile.quantum
File metadata and controls
107 lines (86 loc) · 2.34 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Multi-stage Dockerfile for Quantum Development with D-Wave Ocean SDK
FROM python:3.13-slim as base
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
git \
build-essential \
libffi-dev \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create working directory
WORKDIR /app
# Copy requirements first for better Docker layer caching
COPY requirements.txt .
# Install Python dependencies including D-Wave Ocean SDK
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir \
dwave-ocean-sdk>=7.0.0 \
dwave-system \
dwave-hybrid \
dwave-preprocessing \
dwave-inspectorapp \
networkx \
matplotlib \
scipy \
numpy
# Development stage
FROM base as development
# Install development tools
RUN pip install --no-cache-dir \
pytest \
pytest-asyncio \
pytest-cov \
black \
flake8 \
mypy \
jupyter \
ipython
# Copy application code
COPY . .
# Create directories for quantum operations
RUN mkdir -p /app/.dwave \
/app/quantum_results \
/app/logs \
/app/checkpoints
# Set proper permissions
RUN chmod +x entrypoint.sh
# Expose ports
EXPOSE 8000 8001 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import dwave.ocean; print('Quantum system ready')" || exit 1
# Production stage
FROM base as production
# Copy only necessary files
COPY connectors/ ./connectors/
COPY agents/ ./agents/
COPY mcp_server/ ./mcp_server/
COPY fabric/ ./fabric/
COPY protocols/ ./protocols/
COPY utils/ ./utils/
COPY main.py orchestrator.py entrypoint.sh ./
# Create minimal directories
RUN mkdir -p /app/.dwave /app/quantum_results /app/logs
# Set proper permissions
RUN chmod +x entrypoint.sh && \
useradd -m -u 1000 quantum && \
chown -R quantum:quantum /app
USER quantum
EXPOSE 8000
# Health check for production
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import dwave.ocean; print('Production quantum ready')" || exit 1
# Default to development
FROM development as final
# Entry point script
ENTRYPOINT ["./entrypoint.sh"]
CMD ["quantum-dev"]