Skip to content

Commit

Permalink
Merge pull request #69 from mrkaurelius/fix-fetch-validator-status-deps
Browse files Browse the repository at this point in the history
update docker image, add indy-vdr to deps
  • Loading branch information
WadeBarnes authored Mar 19, 2024
2 parents 6f2c18a + e267a02 commit 1c20c07
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
57 changes: 56 additions & 1 deletion fetch-validator-status/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,59 @@
FROM bcgovimages/von-image:next-1
FROM python:3.10-slim-bullseye

ARG uid=1001
ARG user=indy
ARG tag_name=indy-node-monitor
ARG tag_version=

ENV HOME="/home/$user" \
APP_ROOT="$HOME" \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
PIP_NO_CACHE_DIR=off \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
RUST_LOG=warning \
SHELL=/bin/bash \
SUMMARY="Indy Node Monitor" \
DESCRIPTION="A container for monitoring the nodes of an Indy Node network."

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="$tag_name $tag_version" \
name="$tag_name" \
version="$tag_version" \
maintainer=""

# Add local binaries and aliases to path
ENV PATH="$HOME/.local/bin:$PATH"

# Make libraries resolvable by python
ENV LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH"
RUN echo "$HOME/.local/lib" > /etc/ld.so.conf.d/local.conf && ldconfig

# Add indy user
RUN useradd -U -ms /bin/bash -u $uid $user
WORKDIR $HOME

# - In order to drop the root user, we have to make some directories writable
# to the root group as OpenShift default security model is to run the container
# under random UID.
RUN usermod -a -G 0 indy

# Create standard directories to allow volume mounting and set permissions
# Note: PIP_NO_CACHE_DIR environment variable should be cleared to allow caching
RUN mkdir -p \
$HOME/log \
$(python -m site --user-site)

# The root group needs access the directories under $HOME for the container to function in OpenShift.
# Also ensure the permissions on the python 'site-packages' folder are set correctly.
RUN chown -R indy:root $HOME && \
chmod -R ug+rw $HOME && \
chmod +rx $(python -m site --user-site)

USER $user

ADD requirements.txt .
RUN pip3 install --upgrade pip
Expand Down
5 changes: 4 additions & 1 deletion fetch-validator-status/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ gspread
oauth2client
fastapi
uvicorn
gunicorn
gunicorn

base58
indy-vdr
2 changes: 1 addition & 1 deletion telegraf/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,4 @@
## 1. Local -- interpret based on machine localtime
## 2. "America/New_York" -- Unix TZ values like those found in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
## 3. UTC -- or blank/unspecified, will return timestamp in UTC
json_timezone = ""
json_timezone = ""

0 comments on commit 1c20c07

Please sign in to comment.