3v324v23 commited on
Commit
0ece83b
·
1 Parent(s): 457c6f9

Добавлена правильная структура графов и прокси-конфигурация в Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +142 -11
Dockerfile CHANGED
@@ -85,17 +85,22 @@ RUN cd /app && \
85
  cp -r agents/examples/demo agents/ && \
86
  cp -r agents/examples/experimental agents/
87
 
88
- # Создаем базовый manifest.json
89
  RUN echo '{\n\
 
 
 
90
  "name": "default",\n\
91
  "agents": [\n\
92
  {\n\
93
  "name": "voice_agent",\n\
94
- "description": "A simple voice agent"\n\
 
95
  },\n\
96
  {\n\
97
  "name": "chat_agent",\n\
98
- "description": "A text chat agent"\n\
 
99
  }\n\
100
  ]\n\
101
  }' > /app/agents/manifest.json
@@ -120,23 +125,149 @@ RUN echo '{\n\
120
  ]\n\
121
  }' > /app/agents/property.json
122
 
123
- # Создаем простые примеры графов
124
  RUN echo '{\n\
125
- "nodes": [],\n\
126
- "edges": [],\n\
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  "groups": [],\n\
128
  "templates": [],\n\
129
- "root": null\n\
130
  }' > /app/agents/voice_agent.json
131
 
132
  RUN echo '{\n\
133
- "nodes": [],\n\
134
- "edges": [],\n\
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  "groups": [],\n\
136
  "templates": [],\n\
137
- "root": null\n\
138
  }' > /app/agents/chat_agent.json
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  # Устанавливаем правильные права доступа для всех файлов
141
  RUN chmod -R 777 /app
142
 
@@ -145,7 +276,7 @@ COPY app.py /app/app.py
145
  RUN chmod +x /app/app.py
146
 
147
  # Открываем порты
148
- EXPOSE 7860 8080 3000
149
 
150
  # Запускаем API сервер и Playground в dev-режиме
151
  ENTRYPOINT ["python3", "/app/app.py"]
 
85
  cp -r agents/examples/demo agents/ && \
86
  cp -r agents/examples/experimental agents/
87
 
88
+ # Создаем базовый manifest.json с правильной структурой
89
  RUN echo '{\n\
90
+ "_ten": {\n\
91
+ "version": "0.0.1"\n\
92
+ },\n\
93
  "name": "default",\n\
94
  "agents": [\n\
95
  {\n\
96
  "name": "voice_agent",\n\
97
+ "description": "A simple voice agent",\n\
98
+ "type": "voice"\n\
99
  },\n\
100
  {\n\
101
  "name": "chat_agent",\n\
102
+ "description": "A text chat agent",\n\
103
+ "type": "chat"\n\
104
  }\n\
105
  ]\n\
106
  }' > /app/agents/manifest.json
 
125
  ]\n\
126
  }' > /app/agents/property.json
127
 
128
+ # Создаем простые примеры графов с правильной структурой
129
  RUN echo '{\n\
130
+ "_ten": {\n\
131
+ "version": "0.0.1"\n\
132
+ },\n\
133
+ "nodes": [\n\
134
+ {\n\
135
+ "id": "start",\n\
136
+ "type": "start",\n\
137
+ "data": {\n\
138
+ "x": 100,\n\
139
+ "y": 100\n\
140
+ }\n\
141
+ },\n\
142
+ {\n\
143
+ "id": "openai_chatgpt",\n\
144
+ "type": "openai_chatgpt",\n\
145
+ "data": {\n\
146
+ "x": 300,\n\
147
+ "y": 200,\n\
148
+ "properties": {\n\
149
+ "model": "gpt-3.5-turbo",\n\
150
+ "temperature": 0.7,\n\
151
+ "system_prompt": "Вы полезный голосовой помощник."\n\
152
+ }\n\
153
+ }\n\
154
+ },\n\
155
+ {\n\
156
+ "id": "end",\n\
157
+ "type": "end",\n\
158
+ "data": {\n\
159
+ "x": 500,\n\
160
+ "y": 100\n\
161
+ }\n\
162
+ }\n\
163
+ ],\n\
164
+ "edges": [\n\
165
+ {\n\
166
+ "id": "start_to_chatgpt",\n\
167
+ "source": "start",\n\
168
+ "target": "openai_chatgpt"\n\
169
+ },\n\
170
+ {\n\
171
+ "id": "chatgpt_to_end",\n\
172
+ "source": "openai_chatgpt",\n\
173
+ "target": "end"\n\
174
+ }\n\
175
+ ],\n\
176
  "groups": [],\n\
177
  "templates": [],\n\
178
+ "root": "start"\n\
179
  }' > /app/agents/voice_agent.json
180
 
181
  RUN echo '{\n\
182
+ "_ten": {\n\
183
+ "version": "0.0.1"\n\
184
+ },\n\
185
+ "nodes": [\n\
186
+ {\n\
187
+ "id": "start",\n\
188
+ "type": "start",\n\
189
+ "data": {\n\
190
+ "x": 100,\n\
191
+ "y": 100\n\
192
+ }\n\
193
+ },\n\
194
+ {\n\
195
+ "id": "openai_chatgpt",\n\
196
+ "type": "openai_chatgpt",\n\
197
+ "data": {\n\
198
+ "x": 300,\n\
199
+ "y": 200,\n\
200
+ "properties": {\n\
201
+ "model": "gpt-3.5-turbo",\n\
202
+ "temperature": 0.7,\n\
203
+ "system_prompt": "Вы полезный чат-бот."\n\
204
+ }\n\
205
+ }\n\
206
+ },\n\
207
+ {\n\
208
+ "id": "end",\n\
209
+ "type": "end",\n\
210
+ "data": {\n\
211
+ "x": 500,\n\
212
+ "y": 100\n\
213
+ }\n\
214
+ }\n\
215
+ ],\n\
216
+ "edges": [\n\
217
+ {\n\
218
+ "id": "start_to_chatgpt",\n\
219
+ "source": "start",\n\
220
+ "target": "openai_chatgpt"\n\
221
+ },\n\
222
+ {\n\
223
+ "id": "chatgpt_to_end",\n\
224
+ "source": "openai_chatgpt",\n\
225
+ "target": "end"\n\
226
+ }\n\
227
+ ],\n\
228
  "groups": [],\n\
229
  "templates": [],\n\
230
+ "root": "start"\n\
231
  }' > /app/agents/chat_agent.json
232
 
233
+ # Создаем конфигурацию для Next.js с прокси
234
+ RUN echo '/** @type {import("next").NextConfig} */\n\
235
+ const nextConfig = {\n\
236
+ reactStrictMode: true,\n\
237
+ images: {\n\
238
+ remotePatterns: [\n\
239
+ {\n\
240
+ protocol: "https",\n\
241
+ hostname: "**",\n\
242
+ },\n\
243
+ ],\n\
244
+ },\n\
245
+ experimental: {\n\
246
+ externalDir: true,\n\
247
+ },\n\
248
+ async rewrites() {\n\
249
+ return [\n\
250
+ {\n\
251
+ source: "/api/designer/v1/packages/reload",\n\
252
+ destination: "http://localhost:49483/api/designer/v1/packages/reload"\n\
253
+ },\n\
254
+ {\n\
255
+ source: "/api/dev/v1/packages/reload",\n\
256
+ destination: "http://localhost:49483/api/dev/v1/packages/reload"\n\
257
+ }\n\
258
+ ]\n\
259
+ },\n\
260
+ webpack: (config) => {\n\
261
+ config.module.rules.push({\n\
262
+ test: /\\.svg$/,\n\
263
+ use: ["@svgr/webpack"],\n\
264
+ });\n\
265
+ return config;\n\
266
+ },\n\
267
+ };\n\
268
+ \n\
269
+ module.exports = nextConfig;' > /app/playground/next.config.js
270
+
271
  # Устанавливаем правильные права доступа для всех файлов
272
  RUN chmod -R 777 /app
273
 
 
276
  RUN chmod +x /app/app.py
277
 
278
  # Открываем порты
279
+ EXPOSE 7860 8080 3000 49483
280
 
281
  # Запускаем API сервер и Playground в dev-режиме
282
  ENTRYPOINT ["python3", "/app/app.py"]