Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -10
Dockerfile
CHANGED
|
@@ -1,24 +1,20 @@
|
|
| 1 |
FROM docker.elastic.co/elasticsearch/elasticsearch:8.11.1
|
| 2 |
|
| 3 |
-
#
|
| 4 |
ENV discovery.type=single-node
|
| 5 |
ENV xpack.security.enabled=false
|
| 6 |
-
ENV ES_JAVA_OPTS="-
|
| 7 |
ENV http.port=7860
|
| 8 |
-
ENV http.host=0.0.0.0
|
| 9 |
-
ENV http.cors.enabled=true
|
| 10 |
-
ENV http.cors.allow-origin=$origin
|
| 11 |
-
ENV http.cors.allow-headers="X-Requested-With,Content-Type,Content-Length,Authorization"
|
| 12 |
|
| 13 |
-
#
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
-
#
|
| 17 |
USER elasticsearch
|
| 18 |
|
| 19 |
-
#
|
| 20 |
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
|
| 21 |
CMD curl -f http://localhost:7860/_cluster/health || exit 1
|
| 22 |
|
| 23 |
-
#
|
| 24 |
CMD ["/usr/local/bin/docker-entrypoint.sh"]
|
|
|
|
| 1 |
FROM docker.elastic.co/elasticsearch/elasticsearch:8.11.1
|
| 2 |
|
| 3 |
+
# Set environment variables for Elasticsearch
|
| 4 |
ENV discovery.type=single-node
|
| 5 |
ENV xpack.security.enabled=false
|
| 6 |
+
ENV ES_JAVA_OPTS="-Xms512m -Xmx512m"
|
| 7 |
ENV http.port=7860
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Expose port 7860 (required by Hugging Face Spaces)
|
| 10 |
EXPOSE 7860
|
| 11 |
|
| 12 |
+
# Create a non-root user (HF Spaces requirement)
|
| 13 |
USER elasticsearch
|
| 14 |
|
| 15 |
+
# Health check
|
| 16 |
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
|
| 17 |
CMD curl -f http://localhost:7860/_cluster/health || exit 1
|
| 18 |
|
| 19 |
+
# Start Elasticsearch
|
| 20 |
CMD ["/usr/local/bin/docker-entrypoint.sh"]
|