File size: 956 Bytes
0899f0b
e95e8a7
0899f0b
 
8bd8a4c
0899f0b
c673521
 
7d29877
 
c673521
d97ea6b
85f8dd8
 
9ff5ddd
 
 
 
 
0899f0b
9ff5ddd
bf02a4c
 
9ff5ddd
85de1ce
9ff5ddd
8bd8a4c
 
0899f0b
9ff5ddd
 
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
# 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"]