papri-ka commited on
Commit
27e1777
·
verified ·
1 Parent(s): 2a9b55b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -2,17 +2,17 @@ FROM prom/prometheus:latest
2
 
3
  WORKDIR /app
4
 
5
- # Copy your Prometheus config
6
- COPY turing_cloud.yml .
7
 
8
- # 1. RESET the entrypoint to use shell (Critical Step)
 
 
 
 
9
  ENTRYPOINT ["/bin/sh", "-c"]
10
 
11
- EXPOSE 7860
12
- # 2. Run Prometheus using the shell to expand $PORT
13
- # (I added the external-url flag back, as you likely need it for HF Spaces)
14
- CMD ["/bin/prometheus \
15
- --config.file=/app/turing_cloud.yml \
16
- --web.listen-address=0.0.0.0:$PORT \
17
- --web.external-url=http://r-turing-team-turing-promethetus-server-kvuknls8-5a966-827mr:$PORT/ \
18
- --storage.tsdb.path=/prometheus"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Copy your config
6
+ COPY turing_cloud.yml /app/turing_cloud.yml
7
 
8
+ # Switch to root to ensure permissions (optional but often safer on Spaces)
9
+ USER root
10
+
11
+ # 1. OVERRIDE the default Entrypoint.
12
+ # This tells Docker: "Don't run Prometheus yet. Run a shell instead."
13
  ENTRYPOINT ["/bin/sh", "-c"]
14
 
15
+ # 2. Run the command as a single string.
16
+ # The shell will now expand $PORT correctly before starting Prometheus.
17
+ # We strictly bind to 0.0.0.0 to fix your Timeout issue.
18
+ CMD ["/bin/prometheus --config.file=/app/turing_cloud.yml --web.listen-address=0.0.0.0:$PORT --web.external-url=http://r-turing-team-turing-promethetus-server-kvuknls8-5a966-827mr.hf.space --storage.tsdb.path=/prometheus --web.enable-lifecycle"]