Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +36 -26
Dockerfile
CHANGED
|
@@ -1,26 +1,36 @@
|
|
| 1 |
-
FROM
|
| 2 |
-
RUN echo
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM nginx:alpine
|
| 2 |
+
RUN echo 'server { \
|
| 3 |
+
listen 7860; \
|
| 4 |
+
server_name _; \
|
| 5 |
+
\
|
| 6 |
+
# Отключаем ВСЮ буферизацию \
|
| 7 |
+
proxy_buffering off; \
|
| 8 |
+
proxy_request_buffering off; \
|
| 9 |
+
proxy_cache off; \
|
| 10 |
+
\
|
| 11 |
+
# Настройки таймаутов \
|
| 12 |
+
proxy_connect_timeout 60s; \
|
| 13 |
+
proxy_send_timeout 600s; \
|
| 14 |
+
proxy_read_timeout 600s; \
|
| 15 |
+
\
|
| 16 |
+
# Обработка OpenAI (Codex) \
|
| 17 |
+
location ~* ^/v1/(chat|completions|engines|models) { \
|
| 18 |
+
proxy_pass https://api.openai.com; \
|
| 19 |
+
proxy_set_header Host api.openai.com; \
|
| 20 |
+
proxy_ssl_server_name on; \
|
| 21 |
+
proxy_set_header X-Real-IP $remote_addr; \
|
| 22 |
+
proxy_set_header Connection ""; \
|
| 23 |
+
proxy_http_version 1.1; \
|
| 24 |
+
} \
|
| 25 |
+
\
|
| 26 |
+
# Обработка Anthropic (Claude) и всё остальное \
|
| 27 |
+
location / { \
|
| 28 |
+
proxy_pass https://api.anthropic.com/; \
|
| 29 |
+
proxy_set_header Host api.anthropic.com; \
|
| 30 |
+
proxy_ssl_server_name on; \
|
| 31 |
+
proxy_set_header X-Real-IP $remote_addr; \
|
| 32 |
+
proxy_set_header Connection ""; \
|
| 33 |
+
proxy_http_version 1.1; \
|
| 34 |
+
} \
|
| 35 |
+
}' > /etc/nginx/conf.d/default.conf
|
| 36 |
+
CMD ["nginx", "-g", "daemon off;"]
|