Andy80-Arg commited on
Commit
538f0d2
·
verified ·
1 Parent(s): 76efe59

Update Dockerfile

Browse files

Remove api-key so HF uses Secret variables in HF Settings.

Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -1,24 +1,23 @@
1
- # Use the version mentioned in your logs (30.1)
2
  FROM typesense/typesense:30.1
3
 
4
- # Set environment variables
5
  ENV TYPESENSE_DATA_DIR=/data
6
- ENV TYPESENSE_API_KEY=
7
  ENV TYPESENSE_API_PORT=7860
8
 
9
- # Switch to root to create the directory and fix permissions
10
  USER root
11
-
12
- # 1. Create the data directory
13
- # 2. Ensure it belongs to the user Hugging Face uses (UID 1000)
14
  RUN mkdir -p /data && chown -R 1000:1000 /data
15
 
16
- # Switch back to the Hugging Face user
17
  USER 1000
18
 
19
- # Expose the port HF expects
20
  EXPOSE 7860
21
 
22
- # Start Typesense
23
- # Note: We must explicitly tell Typesense where the data-dir is in the command
24
- CMD ["/opt/typesense-server", "--data-dir", "/data", "--api-port", "7860", "--enable-cors"]
 
 
 
 
1
+ # Use the official v30.1 image
2
  FROM typesense/typesense:30.1
3
 
4
+ # 1. Set internal environment defaults
5
  ENV TYPESENSE_DATA_DIR=/data
 
6
  ENV TYPESENSE_API_PORT=7860
7
 
8
+ # 2. Permissions Setup (Root required for mkdir/chown)
9
  USER root
 
 
 
10
  RUN mkdir -p /data && chown -R 1000:1000 /data
11
 
12
+ # 3. Switch back to HF standard user
13
  USER 1000
14
 
15
+ # 4. Expose the port HF expects (mapped to 443 externally)
16
  EXPOSE 7860
17
 
18
+ # 5. Optimized Startup Command
19
+ # Removed --api-key so it uses the 'TYPESENSE_API_KEY' Secret from HF Settings
20
+ CMD ["/opt/typesense-server", \
21
+ "--data-dir", "/data", \
22
+ "--api-port", "7860", \
23
+ "--enable-cors"]