You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM alpine:latest AS stg1
RUN apk add --update --no-cache binutils
RUN apk add --update --no-cache python3 git py3-pip && \
# ln -sf python3 /usr/bin/python && \
pip3 install --no-cache setuptools pipreqs pyinstaller && \
git clone -b main --single-branch --depth 1 https://github.com/memgraph/prometheus-exporter.git /opt/prometheus_exporter
WORKDIR "/opt/prometheus_exporter"
# get required libraries using pipreqs
RUN pipreqs --force /opt/prometheus_exporter && \
python3 -m pip install -r /opt/prometheus_exporter/requirements.txt
# build executable self contained on opt
RUN pyinstaller --onefile main.py && ln -s ./dist/main ./main
# finally, create the actual container to be run, with only the required files for the exporter and stored in opt
FROM alpine:latest AS stg3
EXPOSE 9115/tcp
ENV PYTHONUNBUFFERED=1
WORKDIR "/opt/prometheus_exporter"
COPY --from=stg1 /opt/prometheus_exporter/main /opt/prometheus_exporter/main
# use echo to write out the config file
ENV MGDBSERVER=memgraph
RUN echo $'exporter:\n port: 9115\nmemgraph:\n endpoint_url: [http://127.0.0.1\n](http://127.0.0.1/n) port: 9091\ngeneral:\n pull_frequency_seconds: 5' > config.yaml && \
sed -i 's/[127.0.0.1/](http://127.0.0.1/)'"${MGDBSERVER}"'/g' /opt/prometheus_exporter/config.yaml
The text was updated successfully, but these errors were encountered:
Example/proposal
The text was updated successfully, but these errors were encountered: