Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +29 -0
- nginx.conf +42 -0
Dockerfile
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Base image with Weaviate
|
2 |
+
FROM cr.weaviate.io/semitechnologies/weaviate:1.30.0
|
3 |
+
|
4 |
+
# Install nginx with grpc support
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y nginx && \
|
7 |
+
apt-get clean
|
8 |
+
|
9 |
+
# Weaviate config
|
10 |
+
ENV QUERY_DEFAULTS_LIMIT=25 \
|
11 |
+
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
|
12 |
+
PERSISTENCE_DATA_PATH=/var/lib/weaviate \
|
13 |
+
ENABLE_API_BASED_MODULES=true \
|
14 |
+
CLUSTER_HOSTNAME=node1
|
15 |
+
|
16 |
+
# Create data dir
|
17 |
+
RUN mkdir -p /var/lib/weaviate && chmod 777 /var/lib/weaviate
|
18 |
+
VOLUME ["/var/lib/weaviate"]
|
19 |
+
|
20 |
+
# Add NGINX config
|
21 |
+
COPY nginx.conf /etc/nginx/nginx.conf
|
22 |
+
|
23 |
+
# Expose only 7860 (used by nginx)
|
24 |
+
EXPOSE 7860
|
25 |
+
|
26 |
+
# Start script
|
27 |
+
CMD ["sh", "-c", "\
|
28 |
+
/bin/weaviate --host 127.0.0.1 --port 7860 --scheme http & \
|
29 |
+
nginx -g 'daemon off;'"]
|
nginx.conf
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
worker_processes 1;
|
2 |
+
|
3 |
+
events {
|
4 |
+
worker_connections 1024;
|
5 |
+
}
|
6 |
+
|
7 |
+
http {
|
8 |
+
include mime.types;
|
9 |
+
default_type application/octet-stream;
|
10 |
+
|
11 |
+
sendfile on;
|
12 |
+
|
13 |
+
upstream weaviate_http {
|
14 |
+
server 127.0.0.1:7860;
|
15 |
+
}
|
16 |
+
|
17 |
+
upstream weaviate_grpc {
|
18 |
+
server 127.0.0.1:50051;
|
19 |
+
}
|
20 |
+
|
21 |
+
server {
|
22 |
+
listen 7860 http2;
|
23 |
+
|
24 |
+
location /v1/ {
|
25 |
+
proxy_pass http://weaviate_http;
|
26 |
+
proxy_set_header Host $host;
|
27 |
+
}
|
28 |
+
|
29 |
+
location / {
|
30 |
+
grpc_pass grpc://weaviate_grpc;
|
31 |
+
error_page 502 = /error502grpc;
|
32 |
+
}
|
33 |
+
|
34 |
+
location = /error502grpc {
|
35 |
+
internal;
|
36 |
+
default_type application/grpc;
|
37 |
+
add_header grpc-status 14;
|
38 |
+
add_header grpc-message "unavailable";
|
39 |
+
return 204;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|