fix: resolve dependency installation issues
Browse files- Split package installations into manageable groups
- Add proper Node.js setup with dependencies
- Install Python packages in logical groups
- Add verification steps
- Clean up after installations
- Dockerfile +78 -10
Dockerfile
CHANGED
@@ -7,15 +7,23 @@ FROM python:3.10-slim-bookworm AS base
|
|
7 |
ARG CACHEBUST=1
|
8 |
ARG DEBIAN_FRONTEND=noninteractive
|
9 |
|
10 |
-
#
|
|
|
|
|
|
|
11 |
RUN apt-get update && \
|
12 |
apt-get install -y --no-install-recommends \
|
13 |
curl \
|
14 |
gnupg \
|
|
|
15 |
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
16 |
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
17 |
&& apt-get update \
|
18 |
-
&& apt-get install -y
|
|
|
|
|
|
|
|
|
19 |
&& npm install -g yarn \
|
20 |
&& apt-get clean \
|
21 |
&& rm -rf /var/lib/apt/lists/*
|
@@ -32,22 +40,23 @@ RUN apt-get update && \
|
|
32 |
libmpfr-dev \
|
33 |
libmpc-dev \
|
34 |
libssl-dev \
|
|
|
|
|
35 |
make \
|
36 |
pkg-config \
|
37 |
&& apt-get clean \
|
38 |
&& rm -rf /var/lib/apt/lists/*
|
39 |
|
40 |
-
#
|
41 |
-
RUN node --version && npm --version && yarn --version
|
42 |
-
|
43 |
-
# Install Python dependencies
|
44 |
RUN pip install --no-cache-dir \
|
45 |
gunicorn \
|
46 |
gevent \
|
47 |
grpcio \
|
48 |
pydantic-settings \
|
49 |
protobuf \
|
50 |
-
grpcio-tools
|
|
|
|
|
51 |
flask \
|
52 |
flask-cors \
|
53 |
Flask-SQLAlchemy==3.1.1 \
|
@@ -59,9 +68,68 @@ RUN pip install --no-cache-dir \
|
|
59 |
flask-jwt-extended \
|
60 |
flask-socketio
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
# ============================================
|
67 |
# Web builder stage - optimized
|
|
|
7 |
ARG CACHEBUST=1
|
8 |
ARG DEBIAN_FRONTEND=noninteractive
|
9 |
|
10 |
+
# Create directory for Node.js setup
|
11 |
+
RUN mkdir -p /etc/apt/keyrings
|
12 |
+
|
13 |
+
# Install Node.js and npm with all dependencies
|
14 |
RUN apt-get update && \
|
15 |
apt-get install -y --no-install-recommends \
|
16 |
curl \
|
17 |
gnupg \
|
18 |
+
ca-certificates \
|
19 |
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
20 |
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
21 |
&& apt-get update \
|
22 |
+
&& apt-get install -y --no-install-recommends \
|
23 |
+
nodejs \
|
24 |
+
build-essential \
|
25 |
+
python3-dev \
|
26 |
+
&& npm install -g npm@latest \
|
27 |
&& npm install -g yarn \
|
28 |
&& apt-get clean \
|
29 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
40 |
libmpfr-dev \
|
41 |
libmpc-dev \
|
42 |
libssl-dev \
|
43 |
+
postgresql-client \
|
44 |
+
redis-tools \
|
45 |
make \
|
46 |
pkg-config \
|
47 |
&& apt-get clean \
|
48 |
&& rm -rf /var/lib/apt/lists/*
|
49 |
|
50 |
+
# Install Python packages in smaller groups to better handle dependencies
|
|
|
|
|
|
|
51 |
RUN pip install --no-cache-dir \
|
52 |
gunicorn \
|
53 |
gevent \
|
54 |
grpcio \
|
55 |
pydantic-settings \
|
56 |
protobuf \
|
57 |
+
grpcio-tools
|
58 |
+
|
59 |
+
RUN pip install --no-cache-dir \
|
60 |
flask \
|
61 |
flask-cors \
|
62 |
Flask-SQLAlchemy==3.1.1 \
|
|
|
68 |
flask-jwt-extended \
|
69 |
flask-socketio
|
70 |
|
71 |
+
RUN pip install --no-cache-dir \
|
72 |
+
PyYAML \
|
73 |
+
celery \
|
74 |
+
redis \
|
75 |
+
psycopg2-binary \
|
76 |
+
sqlalchemy \
|
77 |
+
alembic \
|
78 |
+
pyjwt \
|
79 |
+
requests
|
80 |
+
|
81 |
+
# Install ML and AI packages separately
|
82 |
+
RUN pip install --no-cache-dir \
|
83 |
+
numpy \
|
84 |
+
pandas \
|
85 |
+
python-dotenv \
|
86 |
+
pycryptodome \
|
87 |
+
cryptography \
|
88 |
+
bcrypt \
|
89 |
+
python-jose[cryptography] \
|
90 |
+
passlib \
|
91 |
+
python-multipart \
|
92 |
+
gmpy2
|
93 |
+
|
94 |
+
RUN pip install --no-cache-dir \
|
95 |
+
transformers \
|
96 |
+
torch \
|
97 |
+
tensorflow \
|
98 |
+
sentencepiece \
|
99 |
+
tokenizers \
|
100 |
+
nltk
|
101 |
+
|
102 |
+
# Install remaining packages
|
103 |
+
RUN pip install --no-cache-dir \
|
104 |
+
openai==1.14.0 \
|
105 |
+
anthropic==0.23.1 \
|
106 |
+
Pillow \
|
107 |
+
opencv-python-headless \
|
108 |
+
scikit-learn \
|
109 |
+
scipy \
|
110 |
+
google-cloud-aiplatform \
|
111 |
+
google-generativeai \
|
112 |
+
vertexai \
|
113 |
+
google-cloud-core \
|
114 |
+
google-api-core \
|
115 |
+
yarl \
|
116 |
+
aiohttp \
|
117 |
+
"tritonclient[all]" \
|
118 |
+
cohere==4.43 \
|
119 |
+
replicate \
|
120 |
+
aleph-alpha-client \
|
121 |
+
stability-sdk \
|
122 |
+
huggingface_hub \
|
123 |
+
langchain \
|
124 |
+
langchain-community \
|
125 |
+
langchain-core \
|
126 |
+
langchain-openai
|
127 |
+
|
128 |
+
# Install NLTK data
|
129 |
+
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')"
|
130 |
+
|
131 |
+
# Verify installations
|
132 |
+
RUN node --version && npm --version && yarn --version
|
133 |
|
134 |
# ============================================
|
135 |
# Web builder stage - optimized
|