Spaces:
Sleeping
Sleeping
wjm55
commited on
Commit
·
1462cae
1
Parent(s):
8512b48
Update Dockerfile to change exposed port from 8080 to 7860 and adjust CMD to reflect the new port.
Browse files- Dockerfile +2 -2
- test.py +20 -0
Dockerfile
CHANGED
@@ -6,7 +6,7 @@ ENV QUERY_DEFAULTS_LIMIT=25 \
|
|
6 |
ENABLE_API_BASED_MODULES=true \
|
7 |
CLUSTER_HOSTNAME=node1
|
8 |
|
9 |
-
EXPOSE
|
10 |
|
11 |
# Create data directory with proper permissions
|
12 |
RUN mkdir -p /var/lib/weaviate && \
|
@@ -15,4 +15,4 @@ RUN mkdir -p /var/lib/weaviate && \
|
|
15 |
# Create volume for persistent data
|
16 |
VOLUME ["/var/lib/weaviate"]
|
17 |
|
18 |
-
CMD ["--host", "0.0.0.0", "--port", "
|
|
|
6 |
ENABLE_API_BASED_MODULES=true \
|
7 |
CLUSTER_HOSTNAME=node1
|
8 |
|
9 |
+
EXPOSE 7860 50051
|
10 |
|
11 |
# Create data directory with proper permissions
|
12 |
RUN mkdir -p /var/lib/weaviate && \
|
|
|
15 |
# Create volume for persistent data
|
16 |
VOLUME ["/var/lib/weaviate"]
|
17 |
|
18 |
+
CMD ["--host", "0.0.0.0", "--port", "7860", "--scheme", "http"]
|
test.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import weaviate, os
|
2 |
+
from weaviate.classes.init import Auth
|
3 |
+
from weaviate.config import AdditionalConfig, Timeout
|
4 |
+
|
5 |
+
# Best practice: store your credentials in environment variables
|
6 |
+
http_host = "https://wjbmattingly-weaviate-test.hf.space"
|
7 |
+
grpc_host = "https://wjbmattingly-weaviate-test.hf.space"
|
8 |
+
# weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
|
9 |
+
|
10 |
+
client = weaviate.connect_to_custom(
|
11 |
+
http_host=http_host, # Hostname for the HTTP API connection
|
12 |
+
http_port=8080, # Default is 80, WCD uses 443
|
13 |
+
http_secure=True, # Whether to use https (secure) for the HTTP API connection
|
14 |
+
grpc_host=grpc_host, # Hostname for the gRPC API connection
|
15 |
+
grpc_port=50051, # Default is 50051, WCD uses 443
|
16 |
+
grpc_secure=True, # Whether to use a secure channel for the gRPC API connection
|
17 |
+
# auth_credentials=Auth.api_key(weaviate_api_key), # API key for authentication
|
18 |
+
)
|
19 |
+
|
20 |
+
print(client.is_ready())
|