davanstrien HF staff commited on
Commit
5aaa1d7
1 Parent(s): 0618824

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -3,7 +3,6 @@ FROM qdrant/qdrant:latest
3
 
4
  # Set environment variables
5
  ENV QDRANT_CONFIG_PATH=/qdrant/config/production.yaml
6
- ENV QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}
7
 
8
  # Create necessary directories and set permissions
9
  USER root
@@ -13,6 +12,13 @@ RUN mkdir -p /qdrant/storage /qdrant/snapshots && \
13
  # Copy the custom config file
14
  COPY config.yaml /qdrant/config/production.yaml
15
 
 
 
 
 
 
 
 
16
  # Switch back to the non-root user
17
  USER 1000
18
 
@@ -22,5 +28,5 @@ EXPOSE 6333 6334
22
  # Set the working directory
23
  WORKDIR /qdrant
24
 
25
- # Use the entrypoint script to start Qdrant
26
- ENTRYPOINT ["./entrypoint.sh"]
 
3
 
4
  # Set environment variables
5
  ENV QDRANT_CONFIG_PATH=/qdrant/config/production.yaml
 
6
 
7
  # Create necessary directories and set permissions
8
  USER root
 
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
+ # Persist the API key in a file that can be sourced later
19
+ echo "export QDRANT__SERVICE__API_KEY=$QDRANT__SERVICE__API_KEY" > /qdrant/api_key.sh && \
20
+ chmod +x /qdrant/api_key.sh
21
+
22
  # Switch back to the non-root user
23
  USER 1000
24
 
 
28
  # Set the working directory
29
  WORKDIR /qdrant
30
 
31
+ # Modify the entrypoint to source the API key
32
+ ENTRYPOINT ["/bin/bash", "-c", "source /qdrant/api_key.sh && ./entrypoint.sh"]