File size: 1,029 Bytes
0899f0b
e95e8a7
0899f0b
 
8bd8a4c
0899f0b
c673521
 
 
 
 
d97ea6b
85f8dd8
 
5aaa1d7
 
 
 
 
 
 
c673521
 
 
0899f0b
 
 
8bd8a4c
 
0899f0b
5aaa1d7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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"]