From 667799fdd479cc0e3cb068efe38fb7ce7f185b5a Mon Sep 17 00:00:00 2001 From: "erik.novembit" Date: Sat, 7 Nov 2020 18:21:18 +0400 Subject: [PATCH] App done --- CloudronManifest.json | 2 +- Dockerfile | 12 ++++++++++-- apache/prometheus.conf | 10 ---------- start.sh | 11 ++++------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 3bb311d..0bfe0c4 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -2,7 +2,7 @@ "version": "0.1.0", "id": "eriktad.prometheus.cloudronapp", "author": "Erik Tadevosyan", - "healthCheckPath": "healthcheck", + "healthCheckPath": "/healthcheck", "httpPort": 8000, "icon": "logo.png", "addons": { diff --git a/Dockerfile b/Dockerfile index 89a545f..401cf0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4 -EXPOSE 3000 +EXPOSE 8000 + +RUN mkdir -p /app/data/runtime /app/data/config && \ + chown -R cloudron:cloudron /app/data/runtime /app/data/config + +WORKDIR /app/data # configure apache RUN rm /etc/apache2/sites-enabled/* @@ -17,7 +22,10 @@ RUN mkdir -p /usr/local/bin/prometheus && \ tar xvfz prometheus-*.tar.gz && \ rm -rf prometheus-*.tar.gz && \ mv prometheus-*/* prometheus && \ - rm -rf prometheus-* + rm -rf prometheus-* && \ + chown -R cloudron:cloudron prometheus + +RUN sudo -u cloudron cp -n /usr/local/bin/prometheus/prometheus.yml /app/data/config/prometheus.yml COPY start.sh /app/pkg/ diff --git a/apache/prometheus.conf b/apache/prometheus.conf index 71cf03b..2e4c194 100644 --- a/apache/prometheus.conf +++ b/apache/prometheus.conf @@ -33,14 +33,4 @@ RewriteRule "/healthcheck" - [R=200] - - Order allow,deny - Allow from all - Satisfy Any - - ProxyPreserveHost On - ProxyErrorOverride Off - ProxyPass http://127.0.0.1:9090/ - - diff --git a/start.sh b/start.sh index 6336578..dd51f61 100644 --- a/start.sh +++ b/start.sh @@ -1,15 +1,12 @@ -#!/bin/sh +#!/bin/bash -set -x +set -eu echo "=> Starting apache" APACHE_CONFDIR="" source /etc/apache2/envvars rm -f "${APACHE_PID_FILE}" -/usr/sbin/apache2 -DFOREGROUND - -echo "=> Ensure permissions" -chown -R cloudron:cloudron /usr/local/bin/prometheus +/usr/sbin/apache2 -DFOREGROUND & echo "=> Starting Prometheus" cd /usr/local/bin/prometheus -./prometheus --config.file=prometheus.yml \ No newline at end of file +exec /usr/local/bin/gosu cloudron:cloudron ./prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime \ No newline at end of file