This commit is contained in:
erik.novembit 2020-11-07 18:21:18 +04:00
parent 9966f67393
commit 667799fdd4
4 changed files with 15 additions and 20 deletions

View file

@ -2,7 +2,7 @@
"version": "0.1.0", "version": "0.1.0",
"id": "eriktad.prometheus.cloudronapp", "id": "eriktad.prometheus.cloudronapp",
"author": "Erik Tadevosyan", "author": "Erik Tadevosyan",
"healthCheckPath": "healthcheck", "healthCheckPath": "/healthcheck",
"httpPort": 8000, "httpPort": 8000,
"icon": "logo.png", "icon": "logo.png",
"addons": { "addons": {

View file

@ -1,6 +1,11 @@
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4 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 # configure apache
RUN rm /etc/apache2/sites-enabled/* RUN rm /etc/apache2/sites-enabled/*
@ -17,7 +22,10 @@ RUN mkdir -p /usr/local/bin/prometheus && \
tar xvfz prometheus-*.tar.gz && \ tar xvfz prometheus-*.tar.gz && \
rm -rf prometheus-*.tar.gz && \ rm -rf prometheus-*.tar.gz && \
mv prometheus-*/* prometheus && \ 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/ COPY start.sh /app/pkg/

View file

@ -33,14 +33,4 @@
RewriteRule "/healthcheck" - [R=200] RewriteRule "/healthcheck" - [R=200]
</Location> </Location>
<Location /healthz>
Order allow,deny
Allow from all
Satisfy Any
ProxyPreserveHost On
ProxyErrorOverride Off
ProxyPass http://127.0.0.1:9090/
</Location>
</VirtualHost> </VirtualHost>

View file

@ -1,15 +1,12 @@
#!/bin/sh #!/bin/bash
set -x set -eu
echo "=> Starting apache" echo "=> Starting apache"
APACHE_CONFDIR="" source /etc/apache2/envvars APACHE_CONFDIR="" source /etc/apache2/envvars
rm -f "${APACHE_PID_FILE}" rm -f "${APACHE_PID_FILE}"
/usr/sbin/apache2 -DFOREGROUND /usr/sbin/apache2 -DFOREGROUND &
echo "=> Ensure permissions"
chown -R cloudron:cloudron /usr/local/bin/prometheus
echo "=> Starting Prometheus" echo "=> Starting Prometheus"
cd /usr/local/bin/prometheus cd /usr/local/bin/prometheus
./prometheus --config.file=prometheus.yml exec /usr/local/bin/gosu cloudron:cloudron ./prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime