Spaces:
Runtime error
Runtime error
# Use the official Qdrant image as a base | |
FROM qdrant/qdrant:latest | |
# Set environment variables | |
ENV QDRANT_CONFIG_PATH=/qdrant/config/production.yaml | |
# Create necessary directories and set permissions | |
USER root | |
RUN mkdir -p /data/storage /data/snapshots && \ | |
chown -R 1000:1000 /data | |
# Copy the custom config file | |
COPY config.yaml /qdrant/config/production.yaml | |
# Mount the secret and set it as an environment variable | |
RUN --mount=type=secret,id=QDRANT_API_KEY,mode=0444,required=true \ | |
export QDRANT__SERVICE__API_KEY=$(cat /run/secrets/QDRANT_API_KEY) && \ | |
echo "export QDRANT__SERVICE__API_KEY=$QDRANT__SERVICE__API_KEY" > /qdrant/api_key.sh && \ | |
chmod +x /qdrant/api_key.sh | |
# Switch back to the non-root user | |
USER 1000 | |
# Expose the necessary ports | |
EXPOSE 6333 | |
# Set the working directory | |
WORKDIR /qdrant | |
# Modify the entrypoint to source the API key | |
ENTRYPOINT ["/bin/bash", "-c", "source /qdrant/api_key.sh && ./entrypoint.sh"] |