|
|
|
|
|
FROM alpine:3.15 |
|
|
|
|
|
|
|
|
RUN apk add --no-cache nginx bash curl |
|
|
|
|
|
|
|
|
ENV PROMETHEUS_VERSION=3.3.0 |
|
|
RUN curl -LO https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz \ |
|
|
&& tar xvf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz \ |
|
|
&& mv prometheus-${PROMETHEUS_VERSION}.linux-amd64/prometheus /usr/local/bin/ \ |
|
|
&& mv prometheus-${PROMETHEUS_VERSION}.linux-amd64/promtool /usr/local/bin/ \ |
|
|
&& rm -rf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz prometheus-${PROMETHEUS_VERSION}.linux-amd64 |
|
|
|
|
|
|
|
|
ENV PUSHGATEWAY_VERSION=1.11.1 |
|
|
RUN curl -LO https://github.com/prometheus/pushgateway/releases/download/v${PUSHGATEWAY_VERSION}/pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz \ |
|
|
&& tar xvf pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz \ |
|
|
&& mv pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64/pushgateway /usr/local/bin/ \ |
|
|
&& rm -rf pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64 |
|
|
|
|
|
|
|
|
RUN mkdir -p /prometheus /etc/prometheus /etc/nginx/http.d /var/log/nginx /var/nginx/tmp /var/lib/nginx/logs /run/nginx \ |
|
|
&& chown -R nobody:nobody /prometheus /etc/prometheus /etc/nginx /var/log/nginx /var/nginx/tmp /var/lib/nginx/logs /run/nginx \ |
|
|
&& chmod -R 777 /prometheus /var/log/nginx /var/nginx/tmp /var/lib/nginx/logs /run/nginx |
|
|
|
|
|
|
|
|
COPY --chown=nobody prometheus.yml /etc/prometheus/prometheus.yml |
|
|
|
|
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf |
|
|
COPY default.conf /etc/nginx/http.d/default.conf |
|
|
|
|
|
|
|
|
COPY entrypoint.sh /entrypoint.sh |
|
|
RUN chmod +x /entrypoint.sh |
|
|
|
|
|
|
|
|
EXPOSE 8080 |
|
|
|
|
|
|
|
|
USER nobody |
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"] |