papri-ka commited on
Commit
d8907be
·
verified ·
1 Parent(s): 93cab71

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -1,21 +1,23 @@
1
  FROM prom/prometheus:latest
2
 
3
- # 1. Run as root
4
  USER root
5
-
6
  WORKDIR /app
7
 
8
- # 2. Copy config
9
  COPY turing_cloud.yml /app/turing_cloud.yml
10
 
11
- # 3. Reset Entrypoint
12
  ENTRYPOINT ["/bin/sh", "-c"]
13
 
14
- # 4. Startup Command with Fallback
15
- # ${PORT:-7860} means: "Use $PORT if it exists; otherwise use 7860".
 
 
 
16
  CMD ["export RUN_PORT=${PORT:-7860} && \
17
  echo 'System starting on PORT: '$RUN_PORT && \
18
  sed -i \"s/localhost:7860/localhost:$RUN_PORT/g\" /app/turing_cloud.yml && \
 
19
  /bin/prometheus \
20
  --config.file=/app/turing_cloud.yml \
21
  --web.listen-address=0.0.0.0:$RUN_PORT \
 
1
  FROM prom/prometheus:latest
2
 
 
3
  USER root
 
4
  WORKDIR /app
5
 
6
+ # Copy the config with the placeholder
7
  COPY turing_cloud.yml /app/turing_cloud.yml
8
 
9
+ # Reset entrypoint
10
  ENTRYPOINT ["/bin/sh", "-c"]
11
 
12
+ # Startup Command:
13
+ # 1. Export PORT (fallback to 7860)
14
+ # 2. Inject the PORT into the config
15
+ # 3. Inject the PASSWORD into the config (using | as delimiter to avoid issues with special chars)
16
+ # 4. Start Prometheus
17
  CMD ["export RUN_PORT=${PORT:-7860} && \
18
  echo 'System starting on PORT: '$RUN_PORT && \
19
  sed -i \"s/localhost:7860/localhost:$RUN_PORT/g\" /app/turing_cloud.yml && \
20
+ sed -i \"s|GRAFANA_PASSWORD|$GRAFANA_PASSWORD|g\" /app/turing_cloud.yml && \
21
  /bin/prometheus \
22
  --config.file=/app/turing_cloud.yml \
23
  --web.listen-address=0.0.0.0:$RUN_PORT \