davanstrien HF staff commited on
Commit
9ff5ddd
1 Parent(s): bf02a4c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -5
Dockerfile CHANGED
@@ -12,14 +12,20 @@ RUN mkdir -p /data/storage /data/snapshots && \
12
  # Copy the custom config file
13
  COPY config.yaml /qdrant/config/production.yaml
14
 
15
- # Expose the necessary ports
16
- EXPOSE 6333 6334
 
 
 
17
 
18
- # Switch to non-root user
19
  USER 1000
20
 
 
 
 
21
  # Set the working directory
22
  WORKDIR /qdrant
23
 
24
- # Use the entrypoint script to start Qdrant
25
- ENTRYPOINT ["./entrypoint.sh"]
 
12
  # Copy the custom config file
13
  COPY config.yaml /qdrant/config/production.yaml
14
 
15
+ # Mount the secret and set it as an environment variable
16
+ RUN --mount=type=secret,id=QDRANT_API_KEY,mode=0444,required=true \
17
+ export QDRANT__SERVICE__API_KEY=$(cat /run/secrets/QDRANT_API_KEY) && \
18
+ echo "export QDRANT__SERVICE__API_KEY=$QDRANT__SERVICE__API_KEY" > /qdrant/api_key.sh && \
19
+ chmod +x /qdrant/api_key.sh
20
 
21
+ # Switch back to the non-root user
22
  USER 1000
23
 
24
+ # Expose the necessary ports
25
+ EXPOSE 6334
26
+
27
  # Set the working directory
28
  WORKDIR /qdrant
29
 
30
+ # Modify the entrypoint to source the API key
31
+ ENTRYPOINT ["/bin/bash", "-c", "source /qdrant/api_key.sh && ./entrypoint.sh"]