SatCat commited on
Commit
9b8efb6
·
verified ·
1 Parent(s): a23796a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:3.15
2
+
3
+ RUN apk add --no-cache nginx bash curl
4
+
5
+ ENV PROMETHEUS_VERSION=3.3.0
6
+ RUN curl -LO https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz \
7
+ && tar xvf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz \
8
+ && mv prometheus-${PROMETHEUS_VERSION}.linux-amd64/prometheus /usr/local/bin/ \
9
+ && mv prometheus-${PROMETHEUS_VERSION}.linux-amd64/promtool /usr/local/bin/ \
10
+ && rm -rf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz prometheus-${PROMETHEUS_VERSION}.linux-amd64
11
+
12
+ ENV PUSHGATEWAY_VERSION=1.11.1
13
+ RUN curl -LO https://github.com/prometheus/pushgateway/releases/download/v${PUSHGATEWAY_VERSION}/pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz \
14
+ && tar xvf pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz \
15
+ && mv pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64/pushgateway /usr/local/bin/ \
16
+ && rm -rf pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64
17
+
18
+ RUN mkdir -p /prometheus /etc/prometheus /etc/nginx/http.d \
19
+ && chown -R nobody:nobody /prometheus \
20
+ && chmod -R 777 /prometheus \
21
+ && chown nobody:nobody /etc/prometheus \
22
+ && chown nobody:nobody /etc/nginx/http.d
23
+
24
+ COPY --chown=nobody prometheus.yml /etc/prometheus/prometheus.yml
25
+ COPY nginx.conf /etc/nginx/http.d/default.conf
26
+ COPY entrypoint.sh /entrypoint.sh
27
+ RUN chmod +x /entrypoint.sh
28
+
29
+ EXPOSE 80
30
+ USER nobody
31
+
32
+ ENTRYPOINT ["/entrypoint.sh"]