wjm55 commited on
Commit
2b2af1d
·
1 Parent(s): 08e55bd

Refactor Dockerfile to install NGINX and update CMD for Weaviate and NGINX startup

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,24 +1,30 @@
1
  FROM cr.weaviate.io/semitechnologies/weaviate:1.30.0
2
 
3
- RUN apk update && apk add --no-cache nginx
 
 
4
 
 
5
  ENV QUERY_DEFAULTS_LIMIT=25 \
6
  AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
7
  PERSISTENCE_DATA_PATH=/var/lib/weaviate \
8
  ENABLE_API_BASED_MODULES=true \
9
  CLUSTER_HOSTNAME=node1
10
 
 
11
  RUN mkdir -p /var/lib/weaviate && chmod 777 /var/lib/weaviate
12
  VOLUME ["/var/lib/weaviate"]
13
 
 
14
  COPY nginx.conf /etc/nginx/nginx.conf
15
- COPY start.sh /start.sh
16
- RUN chmod +x /start.sh
17
 
 
18
  EXPOSE 7860
19
 
20
- # Override default entrypoint
21
- ENTRYPOINT []
 
 
22
 
23
- # Run our start script
24
- CMD ["/start.sh"]
 
1
  FROM cr.weaviate.io/semitechnologies/weaviate:1.30.0
2
 
3
+ # Install nginx using Alpine's package manager
4
+ RUN apk update && \
5
+ apk add --no-cache nginx
6
 
7
+ # Set Weaviate env variables
8
  ENV QUERY_DEFAULTS_LIMIT=25 \
9
  AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
10
  PERSISTENCE_DATA_PATH=/var/lib/weaviate \
11
  ENABLE_API_BASED_MODULES=true \
12
  CLUSTER_HOSTNAME=node1
13
 
14
+ # Create data dir
15
  RUN mkdir -p /var/lib/weaviate && chmod 777 /var/lib/weaviate
16
  VOLUME ["/var/lib/weaviate"]
17
 
18
+ # Add NGINX config
19
  COPY nginx.conf /etc/nginx/nginx.conf
 
 
20
 
21
+ # Expose only the one port HuggingFace Spaces allows
22
  EXPOSE 7860
23
 
24
+ # Start both Weaviate and NGINX
25
+ # CMD ["sh", "-c", "\
26
+ # /bin/weaviate --host 127.0.0.1 --port 7860 --scheme http & \
27
+ # nginx -g 'daemon off;'"]
28
 
29
+ CMD ["--host", "0.0.0.0", "--port", "7860", "--scheme", "http"]
30
+ CMD ["nginx", "-g", "daemon off;"]