qdrant_test / Dockerfile
davanstrien's picture
davanstrien HF staff
Update Dockerfile
5aaa1d7 verified
raw
history blame
No virus
1.03 kB
# 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 /qdrant/storage /qdrant/snapshots && \
chown -R 1000:1000 /qdrant
# 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) && \
# Persist the API key in a file that can be sourced later
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 6334
# 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"]