Update Dockerfile
Browse files- 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 |
-
#
|
| 9 |
COPY turing_cloud.yml /app/turing_cloud.yml
|
| 10 |
|
| 11 |
-
#
|
| 12 |
ENTRYPOINT ["/bin/sh", "-c"]
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
#
|
|
|
|
|
|
|
|
|
|
| 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 \
|