weaviate-test2 / Dockerfile
wjm55
Refactor Dockerfile to integrate supervisord for managing Weaviate and Nginx services, replace start.sh with supervisord configuration, and enhance Nginx settings for improved proxy handling. Remove obsolete start.sh script.
72f5836
raw
history blame
2.12 kB
FROM cr.weaviate.io/semitechnologies/weaviate:1.30.0
# Install Nginx and other utilities
RUN apt-get update && \
apt-get install -y nginx supervisor socat && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Environment variables
ENV QUERY_DEFAULTS_LIMIT=25 \
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true \
PERSISTENCE_DATA_PATH=/var/lib/weaviate \
ENABLE_API_BASED_MODULES=true \
CLUSTER_HOSTNAME=node1 \
GRPC_PORT=50051
# Create data directory with proper permissions
RUN mkdir -p /var/lib/weaviate && \
chmod 777 /var/lib/weaviate
# Copy the gRPC proxy script
COPY grpc_proxy.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/grpc_proxy.sh
# Nginx configuration
RUN echo 'events { worker_connections 1024; }' > /etc/nginx/nginx.conf && \
echo 'http { \
server { \
listen 7860; \
location / { \
proxy_pass http://localhost:8080; \
proxy_set_header Host $host; \
proxy_set_header X-Real-IP $remote_addr; \
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \
proxy_set_header X-Forwarded-Proto $scheme; \
} \
} \
}' >> /etc/nginx/nginx.conf
# Configure supervisord to run all services
RUN echo '[supervisord]\n\
nodaemon=true\n\
\n\
[program:weaviate]\n\
command=/bin/weaviate --host 0.0.0.0 --port 8080 --scheme http\n\
stdout_logfile=/dev/stdout\n\
stdout_logfile_maxbytes=0\n\
stderr_logfile=/dev/stderr\n\
stderr_logfile_maxbytes=0\n\
\n\
[program:nginx]\n\
command=/usr/sbin/nginx -g "daemon off;"\n\
stdout_logfile=/dev/stdout\n\
stdout_logfile_maxbytes=0\n\
stderr_logfile=/dev/stderr\n\
stderr_logfile_maxbytes=0\n\
\n\
[program:grpc_proxy]\n\
command=/usr/local/bin/grpc_proxy.sh\n\
stdout_logfile=/dev/stdout\n\
stdout_logfile_maxbytes=0\n\
stderr_logfile=/dev/stderr\n\
stderr_logfile_maxbytes=0' > /etc/supervisor/conf.d/supervisord.conf
# Create volume for persistent data
VOLUME ["/var/lib/weaviate"]
# Expose the main port
EXPOSE 7860
# Run all services using supervisord
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]